Idea
For the final project, I wanted to create a game that uses the ultra sonic sensor to create a trackpad for the movement of the player. As a rough outline, I am thinking of creating a car game in which the goal is to avoid other cars in the lane and get the highest score. It would look something like this:
Arduino
The main component to be used in Arduino would be the ultrasonic sensor which will use the movement of our fingers to move the car along horizontal axis. The reading from the sensor will be provided to p5.js for the x-coordinates of the car. There will also be a button to start the game and a two LEDs to indicate if the game has ended or is still on going.
p5.js
The p5.js would read the values from the ultrasonic sensor and map them to fit the movement of the car and start the game when the button is pressed. The classes for the car, obstacles and other game components will also be created in p5.js. It will also send data to Arduino when the game phase has changed so that the LEDs light up.