Reaction Game

For the reaction game assignment, I did a memory game. Basically, as you can see here, you press the a button and a countdown starts. A random melody plays that increases one note every point you get. You press the end of the red wire to pin one or two to play a note, and can press be to reset the notes that you have played. You have about 14 seconds to repeat the melody. As you can see two dots of red appeared, but that was just a glitch that happens when a wire touches two pins which was caused when I accidentally nudged it.

You can see how I did this here. I used the time variable to keep track of time and used if loops and a variable to see if the conditions were met. I used the arrays as an easy way to keep track of the notes pressed.

However, I did encounter many problems along the way. For example, my microbit code stopped working for no apparent reason. While I did get my code to work, I was not able to find out what went wrong and simply redid the program, rebuilding it from scratch, and I encountered no problems.

Something that really challenged me was when I had to work out how to use the arrays, although I had help it took me a bit to figure out and I was stuck for a while.

I am really proud of how the code is simplistic, but it still can do relatively complex things such as keeping track of keys pressed.

If I could re do this code I think that I would probably try to add more complex rhythms and gamemodes that dictate the hardness of these patterns.

0 comments on “Reaction GameAdd yours →

Leave a Reply

Your email address will not be published. Required fields are marked *