Giant Snake Game Controller

by Vish_R in Circuits > Raspberry Pi

2979 Views, 10 Favorites, 0 Comments

Giant Snake Game Controller

2015-06-05 18.03.01.jpg

The Milwaukee Makerspace was selected for May 2015 Build Night with Raspberry Pi and Adafruit. The Raspberry Pi 2 Model B is faster than the 1st generation. With the increased speed and the Adafruit Perma-Proto HAT for Pi Mini Kit, I had to build an arcade game controller! So, I decided to build a giant game of snake for Maker Faire Milwaukee. Yes - the game famously played on Nokia phones.

In this game, the individual pixels will be made of milk bottles. A projector controlled via the Raspberry Pi will light up the pixels to display the game.

Bill of Materials

The bill of materials:

Controller

Giant_Snake_Game_Controller_2.jpg
Giant_Snake_Game_Controller_1.jpg
2015-06-05 17.59.22.jpg

Game control is done via a joystick connected to a Raspberry Pi's GPIO.

Initially, I soldered female headers to the Perma-Proto HAT so they could be secured to the Raspberry Pi's GPIO. Then, I soldered on screw terminals for the joystick wires. The screw terminals connect the joystick to the Pi's "Digital Inputs".

I used the following script from Adafruit to convert the high signals from the switches to keyboard commands. I simulated arrow keys to coincide with joystick directions.

Enclosure

2015-06-05 18.01.10.jpg
2015-06-05 18.02.23.jpg
2015-06-05 18.00.06.jpg
2015-06-05 18.01.19.jpg

I used a transparent enclosure so players could see the "guts" of the system. I drilled (4) holes on the top of the enclosure and screwed the joystick on. The Pi was placed in the enclosure with double-sided tape.

Software

The game software was a modification of Gareth Halfacree's code from the Raspberry Pi User Guide. It is written using Python and Pygame library. Code can be found here.

I still have to build the physical "pixels." They will be ready by September for Maker Faire Milwaukee.

A preview of the game is attached.

.