Super Smash Pong
Game Explanation
For my school class, If This Then That, I have built a kind of arcade machine where the goal is for the player to throw a ping pong ball and hit the Lucky Block.
Components
I used an Arduino UNO R3, a piezo speaker, a LED light, a pressure sensor, and a button. And obviously some jumper wires.
Design choices
For the actual game, I basically only needed a pressure sensor and some code for the back-end. But I wanted to make it more user-friendly for the player. That's why I added some technical components to the front-end, which communicate the underlying processes of the Arduino to the player to make it a real game.
I soldered a button to my Arduino, which I then connected to the front of the arcade box so that this button becomes visible to the player. When the player presses this button, the game is "primed" (nothing happens before the player presses the button). Then the blue LED light turns on. This LED light communicates to the player that the pressure sensor is active; the player can now throw. When the player manages to hit the Lucky Block with the ping pong ball, a Mario tune plays from the piezo speaker, which communicates to the player that they have won.
After the speaker's tune, the light dims again; the player can then press the button again to play the game again.
Supplies
Supplies (I got them all fromTinyTronics.nl):
-Arduino UNO R3
-YwRobot Breadboard (420 points)
-Piƫzo buzzer 5V
-LED light
-Breadboard Tactile push button
-Taiwan Alpha pressure sensor
Tinkercad Blueprint for the Contraption
This is a concise blueprint (Tinkercad) of my contraption.
Arduino Code to Make It Work (incl. Comments)
This is the code I wrote. The file includes written comments to clarify what each line does to make my game work. I also included a notepad file copy of my code.