A simple helicopter game I built on my phone to learn canvas, JavaScript, and basic game physics.
This is a cave flying game where you control a helicopter through randomly generated caves. The helicopter rises when you tap or click, and falls when you don't. Try to survive as long as possible without crashing into the walls or obstacles.
I wanted to learn how canvas works in JavaScript and understand some basic physics concepts like gravity, velocity, and collision detection. I thought building a game would be more interesting than just following tutorials.
The whole thing was coded on mobile, which made it a bit more challenging but also more interesting.
- Three difficulty levels: easy, medium, and hard
- Randomly generated obstacles
- High score tracking (saved locally)
- Sound effects with toggle option
- Exhaust smoke particles
- Customizable settings
- Smooth cave generation using Perlin noise
Open index.html in your browser. Click or tap to make the helicopter go up. Don't hit the walls or obstacles. That's pretty much it.
- Vanilla JavaScript
- HTML5 Canvas
- Howler.js for audio
- Perlin noise for cave generation
- LocalStorage for score persistence
Building this taught me how canvas rendering works, how to implement basic physics in games, and how collision detection actually works. Also learned that coding on a phone is definitely possible, just a bit tedious.
The code might be a bit messy in places since this was a learning project. Feel free to explore and modify it however you want.