Memory Game

In this project, you will create a memory game. It is a simple game to play, but harder to program! Good luck!


Play this demo in full screen.

1) Create your gameboard by making 4 or more shapes and placing them in rows and columns. When the user clicks a shape, make it animate, play a sound, and change color briefly.


Play this demo in full screen.

2) Next, create an animation that occurs when the computer shows a move. Temporarily, create a set of moves that the computer plays out when the game starts. You will randomize that later. For now, just get the computer to play out the sequence you pre-define.


Play this demo in full screen.

3) Still using the hard-coded sequence that you used in Step 2, have the computer check to see if you are playing that sequence back correctly. If you make an error, have the computer replay the sequence. If you complete the sequence, have the computer repeat the sequence, and check again. Once you are certain the computer is correctly tracking your moves and correctly identifying wrong and correct answers, move to the next step.


Play this demo in full screen.

4) Now, make it so that the sequence of moves has randomly generated moves. The first trial should only have one move. After the player completes a sequence correctly, add one move to the sequence. If the player makes an error, have the game restart with a new sequence.


Play this demo in full screen.

5) Make a button that starts the game. Hide the board before the game starts. When the button is clicked, show the game. Have the button return and board disappear when the game ends.


Play this demo in full screen.

6) When the game ends, show the final score of the player, hide the game board, and show the play game button.


Play this demo in full screen.