Thursday, 9 February 2012

THE CODING


This connects Processing with the Arduino Duemilanove board (which is attached to the pressure pads via Digital pins). It also loads the Red Man graphic which has been saved in the corresponding "data" folder as a png file.


a, b, c and d refer to the vertical levels from top to bottom, indicating each of the four levels at which a shot can be fired.


Finally, this is the code for the firing of the shots, repeated for each of the afore mentioned a, b, c and d. It states the bullet to be a rectangle of size 50 x 20 px. It states the background be black (fill 255). The rest breaks down the animation process as the pressure pad is activated. Quite complicated but I think I understand most of it.

(Note: I also need the Arduino programme running simultaneously in order to recognise my board output.)

Here's my take of it. This helped me get my head around it.

No comments:

Post a Comment