Flappy Bird example
Control the bird with your force-sensing device. Pull on the hangboard to flap; release to fall.
This example is a TypeScript port of aaarafat's JS-Flappy-Bird, a JS and HTML Canvas remake of the original Flappy Bird.
Live demo
Source
Stack
- Vite
- TypeScript
- Canvas
Pattern
- Connect to the device and start streaming (or use
notify()for real-time data). - Use
active()or a threshold ondata.currentto detect a “flap” (user pull). - On flap, apply upward velocity in the game loop.
- Gravity and collision logic run in the same loop.