Skip to content

fbn776/copter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cave Copter

A simple helicopter game I built on my phone to learn canvas, JavaScript, and basic game physics.

What is this?

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.

Why I made this

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.

Features

  • 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

How to play

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.

Tech stack

  • Vanilla JavaScript
  • HTML5 Canvas
  • Howler.js for audio
  • Perlin noise for cave generation
  • LocalStorage for score persistence

What I learned

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.

Notes

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.

Fun fact: The helicopter sprite was drawn in vector asset creator on my phone (android). It’s not the best, but it adds to the charm!

About

A simple js game, where you have to surive with a helicopter in a cave

Topics

Resources

Stars

Watchers

Forks

Contributors