While working on another game idea I bumped into a collision detection sample using the Processing language where you can draw walls for a ball to bounce off. It reminded me of SoundDrop on iOS. Here’s my own mashup using the collision detection code, Tomas Petricek’s reactive rectangles sample for the lines and a generated tremolo sound effect.
I’ve put the code up on Bitbucket: https://bitbucket.org/ptrelford/balls
You can also edit and run the code as a script online in the Tsunami Cloud IDE:
Simply click the picture above to launch the Tsunami IDE with the script. Once loaded press CTRL+A to select the code, then hit the big green run button which will launch a window titled “Drawing”. You can then drag the drawing window out and dock it to the right or left of the code.
If you’re interested in learning more about games programming why not pop down to the F#unctional Londoners meetup this Thursday for a talk on building a game in a day.