Game with Remote Controller
The game itself will be a basic platform game. I’ll program a character to move left, right, and perhaps jump on the screen using the control structure. The Arduino will be the bridge between the physical controller and the digital world.
Here’s how it works: on the Arduino side, I’ll connect tactile buttons (for actions like jumping, attacking) and a joystick (for movement) to the board’s input pins. The Arduino will then read the button presses and joystick movements, interpreting them as game commands. This information is then packaged into a simple data structure and transmitted to the computer via a serial connection.
On the p5.js side, running in the web browser, the program will be set up to receive this data stream from the Arduino. It will decode the data to understand which buttons are pressed and the joystick’s position. Based on these inputs, the p5.js code will control the movement and actions of the game character on the screen.
This project combines the familiar feel of physical buttons and a joystick with the creative potential of p5.js to create a unique interactive game experience. I am also thinking of expanding on this concept by adding more buttons, different control schemes using the joystick axes, and more intricate game mechanics, along the course.