Assignment due December 20


For our final project Russell and I were a bit lost as to what to do. Because the idea of space is so huge and encompassing, we weren’t sure what we could do that would serve the purpose of the name of the class, to be interactive, as well as to be theme appropriate i.e. space-y. Russell suggested a simple idea of maybe just making a space invaders game. We liked the idea and so we started to work with it. Later on however as we prototyped, we decided maybe we wanted to still stay in the same idea but maybe drift a little bit to create something not entirely new but at the same time new for us. We started to make a prototype with simple boxes falling and the user would control another box and ensure it doesn’t explode. Soon afterwards I remembered watching something and the question they asked was if we would be destined to be extinct in the same way the dinosaurs did. I thought it was pretty similar to the prototype we currently had and thought maybe if we had gone back in time we could have protected the earth and the dinosaurs from the asteroids that in the end killed them. Afterwards Russell and I began working on adding images to the boxes to distinguish between the spaceship and the asteroids. 

Robert and I were at first working with just our mousepads to control the spaceship but we thought it wasn’t really as interactive as we want it to be. I decided maybe we could use what we have learnt so far and not so long ago, in our project to make the user feel like they are playing in real space, in a 3D environment rather than on a small laptop. I suggested that  we could create a controller and use brightness tracking or color tracking to track the location of the player and then map it to screen. Robert agreed with this and we fiddled around with brightness tracking, color tracking and even an accelerometer in the off-case that our final location would be too bright to use either color or brightness tracking. In the end color tracking was the most stable and so we decided to work with that. 

Russell and I got a cheap plastic toy gun and we removed the insides and added a small circuit for a button and a led. We placed the led at the tip of the toy gun (where the muzzle is located) so that the user could aim it just like any normal gun as well as Russell attached the trigger of the gun to the button so that when the user pulled the trigger they would be able to press the button and fire bullets in the game. We decided on using a toy pistol as our controller because we thought of its signifiers and its applications. Guns are rather everywhere (sadly) and as such are known by most if not all people and there are very few things to interact with, which in turn makes it very simple and easy to use. We did not label the gun because as aforementioned it is rather straightforward to use. We did however place an ‘x’ on the floor at our booth so as to instruct users where to stand to aim the pistol. 

Prototype Images: 

For the toy gun controller the schematic was very simple. The led that we connected was simply set to high for the entire duration of the game and the button was simply there to detect whether or not the user had pressed the trigger. Both of these components were connected to the Arduino which was then connected to serial for the button press to be registered in Processing. 

The construction was very simple as Russell simply unscrewed the gun and soldered the led and the button to a solderable breadboard. When the user puled the trigger on the toy gun it pressed against the button which in turn sent a high (1) signal to the Arduino. Once the Arduino receives a high from the button it sends it via serial processing to the Processing IDE where we handle the high value and fire missiles/bullets. 


Our project was more a test of all we have learnt in class rather than us trying to incorporate external ideas. We wanted to challenge ourselves by using only content that we had learnt or gone over in class so as to cement these topics better. We did however, have to get a better understanding of the color tracking algorithm so that we could refine it more for our purposes so that we could have it be more reliable in our program and would not be as chaotic as it normally is. 


The code was the most important part of our project (well it was our entire project). The idea of the game, as we have mentioned, was to save the earth, the dinosaurs and even the moon at levels 2 and 3, from certain death. There was a bombardment of asteroids of various random sizes heading for the earth and the player’s goal is to save the earth by shooting the asteroids with the NASA x Rebels collaboration spaceship. 

Arduino Code:


A snippet of our Processing code can be seen below, but because of it’s length you can see the rest on our github page.


  1. One of the most difficult things when creating this game was creating everything from scratch. We are used to using more abstracted languages and so having to create certain classes ourselves was the hardest. Because our game relied a lot on the interaction of one or more elements we had to create rects that had the ability to detect collisions. We had to make our collisions such that the collisions would seem natural. Because of the varying shapes of the objects from circles to squares to irregular shapes, our collision system had to be such that it detects a collision only when it would “visually” be a collision to the player and not because behind the scenes two rectangles are interacting but to the user it seemed as if they were distances apart. Therefore we had to adjust values and the way we calculated how things determined if they were being hit or not.
  2. Another difficulty was in detecting collisions as they happened. Because of Processing’s speed, it runs 60 times per second, therefore to Processing the objects had already passed each other but to the user they were just colliding. We had to make sure that Processing seemed to be recognizing things at the same speed as the user even if that was not the case so it would provide a smoother interface for the user. 
  3. Lastly, we had to make sure that the computer was able to recognize the led at the tip of the gun consistently so that the users would be able to have a consistent, stable and enjoyable gameplay. Therefore we had to change the common color tracking code just a little bit so that it tracks it better. Also, because the computer sees the colors as white sometimes we had to ensure that the color we chose was consistent the most and that we were able to handle the mistakes it made and so it would not disrupt the gameplay for the users too much.

Final Product Images: 


Happy Holidays!

Leave a Reply

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