Table of Contents
WATCH, REMEMBER & PLAY!
The objective of this project is to develop a memory skill game based on the electronic game Simon, produced by Hasbro. This mobile web app, built in HTML, CSS and JavaScript, displays random sequences of colours which the user must repeat from memory. As the user continually enters correct sequences the game progressively selects longer sequences.Simon is a 40-year-old electronic game, currently produced by Hasbro. The game has four coloured buttons that light up and play a sound in sequence. The user then has to replicate the sequence by pressing those buttons in the same order. The sequences become progressively longer and more difficult until the user is unable to repeat the sequence and the game ends.
- While such games are entertaining, the complexity and randomness of the sequences also allows the game to be used as a means of practicing memory storage techniques. There is some evidence that individuals with mild cognitive impairment can benefit from memory enhancement training from such games.
- To make this web app accessible to those in rural areas without the need to develop physical electronic devices.
- Android device
- Internet connection
- Browser support (Google Chrome, preferably)
- Minimum level = 4
- Length of sequence = user’s level
- 2 consecutive failures, Level down.
- Consecutive successes = (user’s level – 2), Level up.
- Touch Mode & Tilt Mode
- Border of the button which the device is tilted towards will be highlighted
- Fluid and simple interface
- Current game information is displayed to user
- Toast message to tell user what to do – Watch/Select Button
- Easy to understand and play
The table shown below depicts some example sequences that might be shown when playing the game.
The difficulty level (sequence length) increases after the user gets a certain number of sequences of that length correct. The number of correct sequences needed to advance is shown in the table below (the number is always two less than the sequence length).
-
For example, at the start of the game, the player is given sequences of length 4. The player receives RRGB followed by GGBY and they get both correct. Since they have entered two sequences correctly, the game now increases to sequences of length 5. The player then receives YYGBR (a sequence of length 5) and needs to enter 3 of further correct sequences to advance to sequences of length 6.
-
Any time the player makes a mistake, they start again at the previous level (or reset to level 4 if they make two consecutive errors). The player cannot be given sequences shorter than 4 (as this is the starting level).
-
There are some situations where it may be too difficult for the user to interact with the app using the buttons on the screen (for example while wearing gloves). As such, we want to allow users to control the app using the phones orientation.
-
When using absolute device orientation there are four values: x, y, z and w; where x value represents the forwards-backwards tilt of the phone. It can visualised as below:
Figure 1: Side view of phone at different beta (x) angles
In Figure 1, where we are looking at the phone from the side, this means that when the device is at on a surface, screen facing up it will have a y value of 0 degrees, tilting the top of the phone down gives a y value of -45 and tilting the top of the phone up gives a y value of +45.
Figure 2: Bottom-side view of phone at different gamma (y) angles
In Figure 2, where we are looking at the bottom of the phone, being at on a surface gives a gamma of 0 degrees, tilting the phone to the left gives it a gamma of -45 whereas tilting to the right gives it +45 degrees.
- Open Windows Command Prompt or any other terminal window and clone repo:
git clone https://github.com/patprem/MemoryTrainingGame.git
OR
Just click on Download ZIP
from Code tab on main page of this repo.
- Open
index.html
to play the game.
If you like this project and interested to contribute:
- Please show your support by ⭐ (star) the project.
- Submit pull requests and improve the repo overall quality.
The codes used in this project borrows from Monash University and are rewritten to incorporate into my project.