跳至主要內容

Assignment 06 Matching Game

AI悦创原创2023年3月30日1v1java 1v1纽约大学一对一NYU 1v1web 一对一数据结构一对一留学生辅导留学生作业辅导1v1java 1v1纽约大学一对一NYU 1v1web 一对一留学生辅导留学生作业辅导大约 15 分钟...约 4371 字

Code written in class

For this assignment you will be creating 'matching game' that will allow visitors to try and match a series of hidden tokens. Speed is key, and the best time will be stored as the 'high score' on your computer - future players will need to try and beat that score in order to become the new matching champion! Here's a quick video that shows the basic features of the system:

对于这个作业,你将创建一个“匹配游戏”,允许访问者尝试和匹配一系列隐藏的令牌。速度是关键,最好的时间将被存储在你的电脑上的“高分”-未来的玩家将需要尝试并打破这个分数,以成为新的匹配冠军!下面是一段简短的视频,展示了该系统的基本功能:

Your program should do the following. You can download all of the artwork used in this project here.

您的程序应该执行以下操作。你可以在这里下载这个项目中使用的所有艺术品。assignment06_images.zip

let assets = ['snorlax.png', 'electrabuzz.png', 'chansey.png', 'oddish.png',
              'pikachu.png', 'paras.png', 'arcanine.png', 'ponita.png',
              'venonat.png', 'eggsecute.png', 'machop.png', 'pidgey.png',
              'psyduck.png', 'tauros.png', 'vulpix.png', 'gloom.png',
              'krabby.png', 'butterfree.png', 'bulbasaur.png', 'clefairy.png',
              'koffing.png', 'goldeen.png', 'magikarp.png', 'beedrill.png',
              'lapras.png', 'meowth.png', 'ekans.png', 'jigglypuff.png',
              'horsea.png', 'polywog.png', 'sandshrew.png', 'rattata.png',
              'gengar.png', 'eevee.png', 'bellsprout.png', 'squirtle.png',
              'seel.png', 'caterpie.png']

Advanced Features「先进的功能」

Next, implement the following features into your game.

接下来,在你的游戏中执行以下功能。

排行榜:使用“localStorage”跟踪游戏的最佳分数。允许用户输入他们的名字,如果他们获得了最好的分数,并将这个名字与他们的时间一起存储在“localStorage”中。在“游戏结束”屏幕上显示这一信息以及他们的分数。

难度选择:让用户选择他们的板子大小(简单:3x4板子;中:4x5板;硬:5x6板)。

积分排行榜扩展:更新你的积分排行榜,这样每个难度级别都有不同的“高分”。

难度选择“粘性”:更新您的程序,使其“记住”最后使用的难度设置。例如,如果用户选择玩一个“硬”游戏(5x6),离开页面,然后返回,默认值应该是“硬”(5x6)

声音:当用户得到正确/不正确的匹配时触发声音。

Extra Credit

Attempt these features only if you have time!「只有在你有时间的时候才尝试这些功能!」

Thoroughly test your work and make sure that it meets the requirements set forth above. When you are finished, post your project to the i6 server and link it from your main menu page. We should be able to visit your 'webdev' folder and click on the link associated with this macro assignment to visit your project. Also create a ZIP archive of your work and submit it to Brightspace under the 'Assignment 06' category.「彻底测试你的工作,并确保它满足上述要求。完成后,将项目发布到i6服务器,并从主菜单页面链接它。我们应该能够访问您的“webdev”文件夹,并点击与此宏分配相关的链接来访问您的项目。同时创建一个ZIP文件,并将其提交到Brightspace的“Assignment 06”目录下。」

Grading Rubric (30 points + 2 points Extra Credit)

CriteriaPoints
Layout: * A 'start' screen that introduces the user to your game and provides them with a button to start the game. This element should be visible to the user when the page loads. * A 'play' screen that contains the play area as well as an indicator to show how much time has elapsed. Note that in the video above this screen contains a 3x4 grid of Pokeballs that you can click on. When setting up your page do not add these images to your HTML as you will probably want to do this using JavaScript. Instead, just create a container to hold your images when you do end up creating them. Set up this element to be invisible when the page initially loads. * A 'game over' screen that shows the user's score as well as the all time high score. It should also contain a button to start the game up again. This element should be invisible when the page loads.3
Game tokens are randomized, and there are a matching # of tokens in each game1
Each token is clickable and swaps to its 'secret' image. Non-matches display for a moment and swap back to their "hidden" state.1
Matches are detected and stay illumated after they have been identified.1
Logic error detection: program functions as expected and does not produce unexpected results. For example, quickly clicking on a game piece will not 'break' the program, and matches that have already been found cannot be re-clicked.5
A timer counts down the elapsed time. The timer always starts at 0.2
When all matches have been found the game over screen appears. The timer stops at this point and the time it took to solve the puzzle appears.2
Program has a replay button that successfully resets the game for another round.2
If the time taken is the "best" time for the game it is announced to the user. This time should also stored in 'localStorage' (you can check the developers console to make sure this is working). Refreshing the game will allow the next user to attempt to beat the previous time.3
Upon the start of the game, the user a choice as to the size of their board (easy: 3x4 board; medium: 4x5 board; hard: 5x6 board). Game uses this information to create an appropriately sized board.3
The program "remembers" the difficulty setting that was last used. For example, if a user elects to play a "hard" game (5x6), leaves the page, and then comes back, the default should be "hard" (5x6). This should be implemented using localStorage, and you can check the developers console to ensure that this value is being set correctly.3
The leaderboard supports separate "high scores" for each difficulty setting.2
Sounds are triggered when the user gets a correct / incorrect match.2
Extra credit: * (1.0 points) Allow the user to change the graphics used in the game - you will need to find / create your own graphics for this. Remember the user's choice using localStorage so that when the come back to the game to play another round their preferred graphics set / board size is pre-selected. * (1.0 points) Animation: Implement a "card flipping" animation when the user selects a graphic. If the match is incorrect you should use the animation to flip it back to its original state.2

欢迎关注我公众号:AI悦创,有更多更好玩的等你发现!

公众号:AI悦创【二维码】

AI悦创·编程一对一

AI悦创·推出辅导班啦,包括「Python 语言辅导班、C++ 辅导班、java 辅导班、算法/数据结构辅导班、少儿编程、pygame 游戏开发」,全部都是一对一教学:一对一辅导 + 一对一答疑 + 布置作业 + 项目实践等。当然,还有线下线上摄影课程、Photoshop、Premiere 一对一教学、QQ、微信在线,随时响应!微信:Jiabcdefh

C++ 信息奥赛题解,长期更新!长期招收一对一中小学信息奥赛集训,莆田、厦门地区有机会线下上门,其他地区线上。微信:Jiabcdefh

方法一:QQ

方法二:微信:Jiabcdefh

你认为这篇文章怎么样?
  • 0
  • 0
  • 0
  • 0
  • 0
  • 0
评论
  • 按正序
  • 按倒序
  • 按热度
通知
关于编程私教&加密文章