For my Gadgets, Sensors, and Activity Recognition in HCI class in Spring 2012 at Carnegie Mellon University, students were tasked with using an Arduino Nano and 8 × 8 LED matrix to create an interactive game. After careful consideration, I chose to implement the arcade game Stacker, which had previously bested me in countless malls and taken many of my dollars.

Duration: Two weeks

Skills used: electronics, hardware prototyping, Arduino programming

Download: Arduino Stacker code (10 kb)

About the game

The goal of Stacker is to stack rows of moving blocks on top of each other using an input button. In the official game, players must stack 11 rows to win a "minor prize" and 15 to win a "major prize." The prizes are usually valued at about 150 times the cost of a single game credit, so it's intended to be a fairly challenging game. As the player freezes a row, the next row up begins moving, but at a slightly faster rate. Any blocks which are not exactly stacked will be lost for use in future rows, and the number of blocks will decrease regardless of performance at certain row levels for an added challenge.

Process

My process began by watching YouTube videos of recorded Stacker games to both make sure I understood the exact movements, animations, and so on. I also did my best to time each row's speed, though this is an imperfect science given the frame rate of recorded videos. After writing some pseudocode of the game logic, I began to prototype my board. The 8 × 8 LED Matrix has some tricky pin access given the prototyping breadboard I was using, so I took care to cut very exact-length wires for neatness. I verified my matrix was wired up correctly by running the Direct Drive LED Matrix sample code from the Arduino playground.

The code itself took a bit of work. I made sure to separate all lighting output from all logical code to ensure high performance and no flicker. A video of the game in action is below. After all of my effort, I'm not sure I've gotten much better at the game.