Processing 2: Air Hockey

This project was designed using Processing 2. My objective was to create a fully functioning game whereby the users could interact with and have fun. My game of choice was Air Hockey. This meant that I had to anticipate two inputs for two users to play. Object Orientated Programming was used to realize this objective. The paddles and puck received their own classes. The interface was designed with the implementation of booleans. The booleans true/false values determined what the user would see on screen i.e. the main menu, the in game play, pause screen and victory screen. The Minim library was used in order to add sound to the game. An algorithm was borrowed from a Processing.org example in order to calculate object collisions.

Mouse input was not my desired type of interaction but I had difficulty with sensors within my timeframe. My original plan was to use two joy pads and an Arduino Uno but I only had access to one and it appeared to be faulty. For the purpose of this demonstration (see video) I used the mouse input and key inputs to control the paddles. Additionally, the mouse is used to call click events with regards to buttons on screen. I am hoping to create a small 2 joy pad circuit in the coming months to controls X and Y input for the paddles.