Aaron Contreras, Owen Yaggy
Shockey resembles a game of air hockey, but all movement is based on electric fields and Coulomb’s law. Instead of “strikers” used to hit the puck, both the user and the computer-controlled opponent will move charged objects around the arena. The puck itself will be a negatively charged particle, meaning the user and the CPU can both attempt to position themselves in an attempt to move the puck in each other’s goal. The user has one added bonus, though: they can flip their charge so they become a positive object, now able to attract the puck instead of repel it. The object of the game is to get the puck into the opponent’s goal (1 point). The user can “free play” (play with no restraints), play “first to 5,” or “1 minute timed round.” The difficulty of the CPU can be adjusted, as can a number of other settings. To increase the utility of this game as a physics simulator, the bottom of the screen will display a number of stats related to the game. The user can also choose to overlay a grid of arrows on the arena indicating the direction of the electric field at that point as it would be experienced by the puck, as well as the magnitude of the electric field at that point, indicated by the color of the arrow (longer corresponds to stronger field). Since the puck is negatively charged, it will move in the opposite direction of the arrows. This project will be programmed using JavaScript and the p5.js library (Processing for JavaScript).
link to project:https://editor.p5js.org/aacontreras20/sketches/ghPKeSgaN *project works for all aspect ratios, but maximize playing space for enhanced user experience
Alternatively, the app directory can be downloaded and the index.html file can be opened to run the project as a standalone in your browser, independently of the p5.js online editor.