Advice on Tower Stacking Game using 8x8 LED Matrix

Hi all

Wanted to set about making a simple rendition of this game (http://skunksoup.com/2011/10/free-online-games/skill-chance/reaction-time-timing/speed-stacker-game) using an Arduino Uno, a push button and an 8x8 LED matrix.

I've reviewed some of the intro code on working with an LED matrix, but I cannot find anything that is similar as a point of reference for where to start with this. I have my circuit wired up and I've tested that everything works, which it does.

Does anyone have any advice on what topics I should be looking into to learn more about how I could go about doing this? Particularly in driving the LED matrix in specific ways (making the LED row or 'blocks' bounce back and forth, detecting if a stack has been successful or not) Any starting point at all really because I am still new to this.

Thanks very much in advance for any help or direction that you can give me on this! I really appreciate it!

I'm not going to bother learning how to play the game just so I can advise you how to write it.

In general, I suggest you think about what data you need to represent the state of the game, how you generate the display from that data, and how you need to modify that data in response to user actions and game actions.

Playing the game, and representing it on the 8x8 matrix are two seperate things. Fortunatly.

Start with writing the game playing code using Serial.print to show output. When that works, then you can worry about how to display it on the LED array. I’d even start with using Serial input rather than button pushes, to get the game logic debugged, completly. Then add button input, then add LEDs. Keep the Serial prints, that way you can verify that you did not disturb the game logic by adding calls to LED display

Or - you can write LED display routines, where you input the state to display as a Serial-input That way you are disconnected from the worries of button debouncing and game logic. You can add these when the LED display routines are working and fault free.

My slant on doing the LED display is to allocate an array (you did not say if it is monochrome or two or RGB LEDs, I’ll assume mono). of 8 bytes. You make LED display routine that will display the bit values to each LED (ie one bytes 8 bits are one row of the LED display). This makes the moving bar very easy - you just use the << or >> operator on the correct row, and then call your display refresh routine.

One thing is for certain. If you want to do blinking of LEDs and all that, you must understand writing a couple of independent timeloops - the grandfather of this is “the blink without delay” example sketch.

Thank you very much! You have been really helpful - I'll give it a go with your advice in mind.