基于区块链的毕业设计Pre-work – Memory Game – 工作前-记忆游戏

本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计Pre-work – Memory Game – 工作前-记忆游戏 是一篇很好的国外资料

Pre-work – Memory Game

Memory Game is a Light & Sound Memory game to apply for CodePath’s SITE Program.

Submitted by: Ethan Shayan Sarnevesht

Time spent: 20 hours spent in total

Link to project: https://cheerful-humane-poison.glitch.me/

Required Functionality

The following required functionality is complete:

  • Game interface has a heading (h1 tag), a line of body text (p tag), and four buttons that match the demo app
  • “Start” button toggles between “Start” and “Stop” when clicked.
  • Game buttons each light up and play a sound when clicked.
  • Computer plays back sequence of clues including sound and visual cue for each button
  • Play progresses to the next turn (the user gets the next step in the pattern) after a correct guess.
  • User wins the game after guessing a complete pattern
  • User loses the game after an incorrect guess

The following optional features are implemented:

  • Any HTML page elements (including game buttons) has been styled differently than in the tutorial
  • Buttons use a pitch (frequency) other than the ones in the tutorial
  • More than 4 functional game buttons
  • Playback speeds up on each turn
  • Computer picks a different pattern each time the game is played
  • Player only loses after 3 mistakes (instead of on the first mistake)
  • Game button appearance change goes beyond color (e.g. add an image)
  • Game button sound is more complex than a single tone (e.g. an audio file, a chord, a sequence of multiple tones)
  • User has a limited amount of time to enter their guess on each turn

The following additional features are implemented:

  • Time left for each turn is rendered to screen every decisecond
  • Current amount of lives are on updated on screen

Video Walkthrough

Here’s a walkthrough of implemented user stories:

  1. Winning a game (with lives/timer functionality)
    • Pre-work - Memory Game - 工作前-记忆游戏
  2. Losing lives to lose game
    • Pre-work - Memory Game - 工作前-记忆游戏
  3. Running out of time to lose game in a turn
    • Pre-work - Memory Game - 工作前-记忆游戏
  4. Stopping in middle of a game, stopping timer and resetting lives
    • Pre-work - Memory Game - 工作前-记忆游戏

Full length demo with sound

Reflection Questions

  1. If you used any outside resources to help complete your submission (websites, books, people, etc) list them here. w3schools MDN Web Docs WebDev Subreddit on reddit.com StackOverflow

  2. What was a challenge you encountered in creating this submission (be specific)? How did you overcome it? (recommended 200 – 400 words) To add the functionality for having a countdown at the beginning of each turn, I decided to start the timer right after the clue sequence ended. However, I couldn’t simply start the ‘setInterval()’ method right after the clue sequence code block right away because the the clue sequence had a delay. I had to figure out how to calculate when the delay would end so I’d know when to start counting. So I tried a lot of different methods for calculating the right delay until I found the last ‘delay’ iteration plus the clueHoldTime to work. From there I used the setTimeout method to delay the setInterval method by that much. Another challenger was when I tested the game outside of the playground, and in the cheerful-humane-poison.glitch.me domain, the sounds weren’t working, so I did some research and found that google chrome has a security protocol that does not allow sound from the browser until the user has clicked on something. So I looked up how to resume the sound of the game and found a place in the code such that at that point it would start the sound using the statement. ‘context.resume()’ Another challenge was that when I clicked the stop button in the middle of a clue sequence playing, the timer would still go afterwards since there was a delay for the timer to start after the clue sequence. After lots of debugging to find out why this was the case, I found out that I would need to check if the game was still going on in my setTimeout-invoked timer function, using a global boolean variable gamePlaying. By first checking that the game was still going on in my myTimer() function invoked by setTimeout(), I made sure I would never start a timer unless a game was in session.

  3. What questions about web development do you have after completing your submission? (recommended 100 – 300 words)

    • How is it possible that we are able to use the sound library and the setInterval/clearInterval methods without having to explicitly import any javascript libraries at the top of script.js?
    • Do typical object-oriented methodologies such as inheritance, polymorphism, and encapsulation commonly seen in Java/C++ also apply to javascript?
    • Why is it that we can write complicated javascript logic and functions that compile in-browser, but when you need a dedicated backend using python or another backend language, the browser doesn’t compile that code?
    • Although I understand that javascript is a weakly-typed language, is there anyway to cast a variable to another type? Or is type only handled under the hood and not explicitly available to be used in the code?
    • Why is it so complicated to center a block of code and why are there different to do so with text blocks versus divs? Do most developers at Top Tier tech companies such as Workday use work-arounds like Flexbox or what is the standard industry protocol?
  4. If you had a few more hours to work on this project, what would you spend them doing (for example: refactoring certain functions, adding additional features, etc). Be specific. (recommended 100 – 300 words) For future iterations of the project, I would include a pre-game set of instructions for the user to specify the difficulty of the game setting from easy, medium, to hard.

    • For the easy mode, the user would have to guess a maximum of 6 keys in a sequence over the course of the game. Each key sequence playback would start at the defaulted 1000 milliseconds, and each playback thereafter would decrease by the original playback (1000ms) divided by the number of keys, 6. Last, the time per turn would be 20 seconds.
    • For medium mode, the user would guess a sequence 12 keys over the course of the game. Each key sequence would decrease by 3 times the original playback (3000ms) divided by the number of keys, 12. Last, the time per turn would be 15 seconds.
    • For hard mode, the user would guess a sequence of 15 keys over the course of the game. Each key sequence would decrease by 5 times the original playback (5000ms) divided by the number of keys, 15. Last, the time per turn would be 10 seconds.

License

Copyright [Ethan Shayan Sarnevesht]  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at      http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 

工作前记忆游戏

记忆游戏是一款光声记忆游戏,适用于CodePath的网站程序。

提交人:Ethan Shayan Sarnevesht

花费时间:总共花费20小时

链接到项目:https://journey-human-poison.glitch.me/

所需功能

完成以下所需功能:

  • 游戏界面有一个标题(h1标签),一行正文(p标签),与演示应用程序匹配的四个按钮单击时,“开始”按钮在“开始”和“停止”之间切换。
  • 单击游戏按钮时,每个按钮都会亮起并播放声音。
  • 计算机播放一系列线索,包括每个按钮的声音和视觉提示,在正确猜测后,播放进行到下一轮(用户获得模式中的下一步)。
  • 用户猜中完整模式后赢得游戏
  • 用户猜中错误后输掉游戏
  • 任何HTML页面元素(包括游戏按钮)的样式与教程中的不同
  • 按钮使用的音调(频率)超过教程中的音调(频率)

实现以下可选功能:

  • 功能性游戏按钮
  • 每转一圈,播放速度就会加快
  • 每次玩游戏时,电脑会选择不同的模式
  • 玩家只会在3次错误后(而不是第一次错误时)才输
  • 游戏按钮的外观变化超出了颜色(例如添加图像)
  • 游戏按钮的声音更为清晰比单音复杂(例如音频文件、和弦、,多个音调的序列)
  • 用户在每个回合有有限的时间输入他们的猜测
  • 每个回合剩余的时间每分秒呈现到屏幕上
  • 屏幕上当前的生命量更新

实现以下附加功能:

  • 赢得游戏(使用生命/计时器功能)Pre-work - Memory Game - 工作前-记忆游戏
  • 失去生命输掉比赛,停止计时器并重置生活如果您使用任何外部资源帮助完成提交(网站、书籍、人员等),请在此处列出。w3mdn网站文档WebDev Subreddit onreddit.com网站StackOverflow

视频演练

下面是已实现用户案例的演练:

  1. 您在创建此提交时遇到了什么挑战(请具体说明)?你是怎么克服的?(推荐200-400字)为了增加在每个回合开始时倒计时的功能,我决定在线索序列结束后立即启动计时器。但是,我不能在线索序列代码块之后立即启动“setInterval()”方法,因为线索序列有延迟。我得想办法计算延迟何时结束,这样我才能知道什么时候开始计数。所以我尝试了很多不同的方法来计算正确的延迟,直到我找到了最后一个“延迟”迭代加上clueHoldTime。在那里,我使用setTimeout方法将setInterval方法延迟了那么多。另一个挑战者是我在操场外,在欢乐的教室里测试比赛的时候-毒药。故障。我域,声音不起作用,所以我做了一些研究,发现google chrome有一个安全协议,在用户单击某个东西之前不允许从浏览器发出声音。所以我查了一下如何恢复游戏的声音,并在代码中找到了一个位置,这样它就可以使用语句启动声音了上下文.简历()“另一个挑战是,当我在播放线索序列的过程中单击“停止”按钮时,计时器仍会继续运行,因为在播放线索序列之后计时器启动会有延迟。在进行了大量调试以找出原因之后,我发现我需要使用全局布尔变量gamePlaying在setTimeout调用的计时器函数中检查游戏是否仍在进行。通过首先在setTimeout()调用的myTimer()函数中检查游戏是否仍在进行,我确保了除非游戏处于会话中,否则我永远不会启动计时器。
  2. 我们如何能够使用声音库和setInterval/clearInterval方法,而不必在脚本.js?在爪哇/C++中常见的典型的面向对象方法,如继承、多态和封装,也适用于JavaScript吗?
  3. 尽管我知道javascript是一种弱类型的语言,但是否有必要将变量转换为另一种类型?或者类型只在引擎盖下处理,而不能显式地用于代码中?
  4. 如果你有更多的时间来做这个项目,你会花他们做什么(例如:重构某些函数,添加其他特性等等)。具体点。(建议100-300字)对于项目的未来迭代,我将包括一组游戏前的说明,供用户指定游戏设置的难度,从简单、中等到困难。对于简单模式,用户必须在游戏过程中猜出最多6个键。每个键序列的播放将以默认的1000毫秒开始,此后的每次播放将按原始播放时间(1000毫秒)除以键数6来减少。最后,每转的时间是20秒。对于中等模式,用户将猜测一个序列12键在游戏过程中。Ea公司

完整的声音演示

反思问题

  1. 如果您使用任何外部资源来帮助完成提交(网站、书籍、人员等),请在此处列出它们。w3mdn网站文档WebDev Subreddit onreddit.com网站StackOverflow

  2. 您在创建此提交时遇到了什么挑战(请具体说明)?你是怎么克服的?(推荐200-400字)为了增加在每个回合开始时倒计时的功能,我决定在线索序列结束后立即启动计时器。但是,我不能在线索序列代码块之后立即启动“setInterval()”方法,因为线索序列有延迟。我得想办法计算延迟何时结束,这样我才能知道什么时候开始计数。所以我尝试了很多不同的方法来计算正确的延迟,直到我找到了最后一个“延迟”迭代加上clueHoldTime。在那里,我使用setTimeout方法将setInterval方法延迟了那么多。另一个挑战者是我在操场外,在欢乐的教室里测试比赛的时候-毒药。故障。我域,声音不起作用,所以我做了一些研究,发现google chrome有一个安全协议,在用户单击某个东西之前不允许从浏览器发出声音。所以我查了一下如何恢复游戏的声音,并在代码中找到了一个位置,这样它就可以使用语句启动声音了上下文.简历()“另一个挑战是,当我在播放线索序列的过程中单击“停止”按钮时,计时器仍会继续运行,因为在播放线索序列之后计时器启动会有延迟。在进行了大量调试以找出原因之后,我发现我需要使用全局布尔变量gamePlaying在setTimeout调用的计时器函数中检查游戏是否仍在进行。通过首先在setTimeout()调用的myTimer()函数中检查游戏是否仍在进行,我确保了除非游戏处于会话中,否则我永远不会启动计时器。

  3. 完成提交后,您对web开发有哪些问题?(推荐100-300字)

    • How is it possible that we are able to use the sound library and the setInterval/clearInterval methods without having to explicitly import any javascript libraries at the top of script.js?
    • Do typical object-oriented methodologies such as inheritance, polymorphism, and encapsulation commonly seen in Java/C++ also apply to javascript?
    • Why is it that we can write complicated javascript logic and functions that compile in-browser, but when you need a dedicated backend using python or another backend language, the browser doesn’t compile that code?
    • Although I understand that javascript is a weakly-typed language, is there anyway to cast a variable to another type? Or is type only handled under the hood and not explicitly available to be used in the code?
    • Why is it so complicated to center a block of code and why are there different to do so with text blocks versus divs? Do most developers at Top Tier tech companies such as Workday use work-arounds like Flexbox or what is the standard industry protocol?
  4. 如果你有更多的时间来做这个项目,你会花他们做什么(例如:重构某些函数,添加额外的特性等等)。具体点。(建议100-300字)对于项目的未来迭代,我将包括一组游戏前的说明,供用户指定游戏设置的难度,从简单、中等到困难。

    • For the easy mode, the user would have to guess a maximum of 6 keys in a sequence over the course of the game. Each key sequence playback would start at the defaulted 1000 milliseconds, and each playback thereafter would decrease by the original playback (1000ms) divided by the number of keys, 6. Last, the time per turn would be 20 seconds.
    • For medium mode, the user would guess a sequence 12 keys over the course of the game. Each key sequence would decrease by 3 times the original playback (3000ms) divided by the number of keys, 12. Last, the time per turn would be 15 seconds.
    • For hard mode, the user would guess a sequence of 15 keys over the course of the game. Each key sequence would decrease by 5 times the original playback (5000ms) divided by the number of keys, 15. Last, the time per turn would be 10 seconds.

许可证

Copyright [Ethan Shayan Sarnevesht]  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at      http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 

部分转自网络,侵权联系删除区块链源码网

www.interchains.cc

https://www.interchains.cc/21043.html

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 ! QQ3039046426
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计Pre-work – Memory Game – 工作前-记忆游戏

提供最优质的资源集合

立即查看 了解详情