I built this Arduino/Processing game as a school assignment. The assignment was to build an Arduino game and i decided to build mine as a simple arduino circuit and a more complicated software design. The way the game works is your character, a cougar, (my school mascot) moves up and down and depending on the pressure applied onto the pressure sensor. The harder you push on the pressure sensor the higher your character goes. The goal of the game is to go through the two rectangles without hitting into them. Once the game picks up power ups become available and you can either get a ghost, which allows you to go right through the rectangles without dyeing or a snail power up which slows down the game making it easier to safely go through the two rectangles.
force sensor (around $5.00)
10k ohm resistor (basically free)
Arduino (i used an uno but any one will do)
Arduino programming language (free and could be downloaded off their website)
Processing programming language (free and could be downloaded off their website)
breadboard (This is optional you are able to do it with just soldering)
Step 1: Hardware - Connecting the Pressure Sensor to the Arduino.
Put your pressure sensor in the breadboard. One side of the pressure sensor attach to one side of the 10k ohm resistor and the other side of the pressure sensor attach to 5v pin on the Arduino. the empty side of the resistor attach to the ground pin in the Arduino. and the middle which should be both the pressure sensor and the resistor attaches to the A1 pin in the Arduino. Make all the connections with jumper cables.
Step 2: Downloading the Software
Download the Arduino software and upload it onto your Arduino, in Arduino open the tools and then port and see what port your sketch is being uploaded through and write it down you will need this information. Then download the processing sketch and open it. go throug the code and put your serial port in between the quotes like this its around line 91 and it can be found by running the code and it will be highlighted.
port = new Serial(this, "/dev/cu.usbmodem1411", 9600);
then run your sketch and your good to go.
if you are not good to go you might need to go into the proseccing
I put my entire project in box so it looked good. I hope you like it.