Final Project Concept:
“Tokyo Flight” is an interactive flying game that is inspired by one of Ghibli movies called The Wind Rises. The player controls a cardboard airplane equipped with an accelerometer and a button, both of which are connected to Arduino. The way the game works is that the user is going to tilt the airplane and the airplane on p5 will follow the movement of the tilt. The goal of the game is to pass through as many floating rings as possible without touching them or going out of the canvas. If users press the button on the airplane, then the speed of the airplane on p5 will boost up to help reach difficult rings. If the player collides with a ring or flies out of the screen, the flight ends.
Arduino Components:
-
- Accelerometer (MPU6050) inside the airplane: It measures the tilt forward and backward. Possibly left or right tilt as well.
- Push buttons: It triggers a temporary speed boost.
- LED lights: Light up when the boost is active
What Arduino does:
-
- Read sensor values:
- It continuously read acceleration + gyroscope data from the MPU 6050
- We smooth the data to remove the noise
- We convert the tilt into a single value (from -90 degrees to 90)
- Read button state:
- We check if the button is pressed or not
- Sends a signal (0 or 1)
- We send data to p5.js through webserial
- Additional feature:
- We receive signals from p5 to blink LED when boost is available
- Vibrate the motor when the user crashes
- Read sensor values:
What p5.js game will do:
-
- Connect to arduino via webserial
- We parse incoming serial strings and extract tilt angle and button state
- Control the on-screen airplane
- We map tilt to the airplane’s vertical position.
- We also map horizontal tilt to slight horizontal drift
- If speed boost button is pressed, we increase forward movement temporarily
- Generate game objects:
- Rings appear from the right and move left
- Rings vary in size and vertical position
- We generate a wind to affect the airplane’s movement
- Collision detection:
- If the airplane touches ring boundary, it is game over
- If the airplane goes beyond the canvas, it is game over.
- Scoring System
- +5 for passing through small rings
- +2 for passing through big rings
- Visual and Audio design:
- We will have a soft blue sky with clouds and a green glassfield at the bottom to represent Wind Rises.
- We will also play Ghibli audio while the game is playing
- Send feedback to Arduino
- Arduino flashes LED lights when the airplane crashes
- Arduino keeps lights on when the airplane is on boost mode
- Arduino vibrates when the airplane goes through the rings.
- Connect to arduino via webserial