Skip to content

gkashinath/rocket-launcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rocket Launcher!

A kid-friendly rocket launcher game that teaches basic physics intuition through play. Adjust sliders, launch a rocket, hit targets, and earn stars!

Who Is This For?

Designed for kids aged 5 and up. No reading required — all controls use icons, colors, and big touch-friendly targets. There are no fail states or penalties; stars only accumulate, so every launch is a success.

How It Works

Controls

The game has 4 color-coded sliders, each with a mini live-preview icon:

Slider Color What It Does
Angle Orange Sets the launch angle (10°–85°)
Fuel Green Controls how long the engine burns (more fuel = farther)
Nose Cone Blue Morphs between pointy (less drag) and round (more drag)
Rocket Size Yellow Scales the rocket from small & light to big & heavy

A dashed trajectory preview updates in real-time as you adjust sliders, showing where the rocket will land.

Press the big green Launch button to fire!

Gameplay Loop

  1. Setup — Adjust sliders and watch the trajectory preview
  2. Countdown — 3-2-1-GO! with sound effects
  3. Flight — Watch the rocket fly with flame and smoke particles
  4. Landing — Dust cloud on impact
  5. Result — Stars awarded based on accuracy, then auto-resets

Targets & Scoring

Each round has 3 bullseye targets at increasing distances:

  • Easy (~125m, wide) — good for learning
  • Medium (~300m) — requires tuning
  • Hard (~600m, narrow) — for advanced players

Stars are awarded based on landing accuracy:

  • 3 stars — Bullseye! (center 15%)
  • 2 stars — Inner ring (center 40%)
  • 1 star — Anywhere on target
  • 0 stars — Miss (but no penalty!)

Targets shift farther and shrink each round for progressive difficulty.

Physics

Under the hood, the game simulates real physics:

  • Thrust, gravity, and aerodynamic drag
  • Nose cone shape affects drag coefficient
  • Rocket size affects mass and cross-sectional area
  • Semi-implicit Euler integration (the same method used in engineering simulations)

How to Use

  1. Open index.html in any modern browser (Chrome, Edge, Firefox, Safari)
  2. That's it — no install, no build step, no server needed

Works on desktop and tablets. On narrow screens, sliders rearrange into a 2×2 grid.

Audio

All sounds are synthesized in the browser using the Web Audio API — no audio files needed. Sounds activate after your first interaction (browser autoplay policy). Includes countdown beeps, engine rumble, landing thud, and star chimes.

Project Structure

├── index.html          # Entry point
├── css/styles.css      # Layout, slider theming, animations
└── js/
    ├── constants.js    # All tuning knobs (physics, colors, timing)
    ├── physics.js      # Pure math engine (no DOM — portable to MATLAB)
    ├── rocket.js       # Rocket data model
    ├── gameState.js    # State machine (SETUP→COUNTDOWN→FLIGHT→LANDING→RESULT)
    ├── targets.js      # Target placement and scoring
    ├── camera.js       # Viewport pan/zoom/follow
    ├── particles.js    # Flame, smoke, dust, star sparkle effects
    ├── audio.js        # Synthesized sounds via Web Audio API
    ├── renderer.js     # All canvas drawing
    ├── ui.js           # Slider wiring, launch button, HUD
    └── main.js         # Game loop and module wiring

physics.js has zero DOM/Canvas dependencies and is designed for direct porting to MATLAB App Designer.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors