Space Invaders Arcade

Today, I’d like to share about another of my projects. A space invaders arcade game!

It was done as part of UT.6.01x Introduction Embedded Systems, which teaches the basics of micro-controllers such as how to interface external components, how to read analog inputs like switches & produce analog outputs like sound, how to use timers & interrupts, etc.

This MOOC culminated in an optional final project where we were required to build a 80’s styled arcade game. I decided to go with the teachers’ recommendation of Space Invaders and it resulted in the game below.

There is a short 1 minute demo embedded above to demonstrate basic game-play. The player simply controls the ship & shoots 3×2 enemy hordes which gets faster & shoot more often with each new wave. The best thing is the levels never end & there is theoretically unlimited game-play.

However, the feature I am most proud of & put most effort into is making the code easily editable. I’ve used several #define which allow several parameters to be changed easily, ranging from graphical options, like the dimension of the enemy hordes & vertical layout of the battlefield, to game-play options, such as the number of bunkers and UFO spawn rate. Even the learning curve of the game is purposely encoded in 2 explicitly labelled recursive mathematical formulaes, and this can be completely changed if desired.

Here is a picture of the physical circuit which I built. It’s a simple circuit really. The micro-controller is on the right, a 4-bit DAC at the top & a swtich and potentiometer near the bottom. Do note that I don’t have a physical screen & instead used a virtual one.

Space Invaders Arcade

If you’d like to tinker with the code, it is already up on my GitHub.
If you’d like to build the physical system yourself, here is a parts list:

  1. Texas Instruments TIVA launchpad (STELLARIS might work too)
  2. Nokia5110 LCD Screen (or the VirtualScreen which can be found in my GitHub)
  3. 4 resistors of n, 2n, 4n, 8n (for a 4-bit sound DAC)
  4. 1 audiojack (unless you don’t want sound)
  5. 1 potentiometer (for movement)
  6. 1 switch (fire button)
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s