A 3D aerial combat game built with Three.js. Fly a fighter jet, shoot down drone swarms and enemy jets, survive every wave, and clear all five levels.
No install, no build step. Just open index.html in a browser.
For live-reload during development:
# Option A — VS Code: right-click index.html → "Open with Live Server"
# Option B — Python
python3 -m http.server 8080
# then open http://localhost:8080| Input | Action |
|---|---|
W |
Throttle up (accelerate) |
S |
Throttle down (decelerate) |
A / D |
Yaw left / right |
Mouse |
Aim crosshair |
Space (hold) |
Fire bullets |
LMB (click) |
Fire missile |
R |
Barrel roll (destroys all incoming missiles) |
ESC |
Pause / resume |
Missile targeting: aim at an enemy and click LMB. Missiles fired at jets home automatically. Missiles fired at drones fly straight from your nose — use the aim dot for direction.
| # | Name | Waves | Notes |
|---|---|---|---|
| 1 | First Contact | 3 | Mostly drones, 1–2 jets |
| 2 | Interceptors | 3 | Balanced drones + jets |
| 3 | Ace Squadron | 4 | Jet-heavy, elite AI |
| 4 | Full Assault | 5 | Large mixed swarms |
| 5 | Last Stand | 6 | Max enemies, no mercy |
Complete all waves in a level to unlock the next. Each level starts a countdown then drops you straight into the first wave.
Drones — slow, fragile (1 bullet = destroyed). Fire straight-shot missiles with a splash radius. Bigger hitbox, easier to see.
Enemy Jets — fast (~100 u/s), orbit the player, attack in bursts. Fire bullet sprays and homing missiles. Take multiple hits to destroy.
- Health — 100 HP. Enemy bullets deal 10 HP each; enemy missiles deal 20 HP.
- Bullets — rapid fire but overheat after ~3 seconds of continuous firing. Cools automatically; full overheat locks the gun for 2 seconds.
- Speed lines — appear above 60% of max speed for visual feedback.
- Camera — chase cam follows the jet with yaw-adjusted offset and dynamic FOV (wider at high speed).
- Aim dot — static indicator above the jet nose shows where bullets will fly.
- Flythrough — after a level ends or the player dies, the jet keeps coasting while the result screen fades in over the scene.
index.html — HTML shell + UI overlays (Tailwind CSS)
js/
config.js — all tunable constants
input.js — keyboard + pointer lock + virtual cursor
flight.js — throttle, yaw, barrel roll
drone.js — player jet mesh and visuals
enemies.js — drone + jet AI state machines
weapons.js — bullet/missile pools, heat system, splash damage
combat.js — wave state machine, spawning, HP
effects.js — explosions, particles, speed lines
audio.js — Web Audio engine + HTML Audio music tracks
levels.js — level data loading (assets/levels.json)
ui.js — HUD, speed gauge, crosshair, aim dot, screens
course.js — sky environment (clouds, terrain decorations)
main.js — init, game loop, state machine wiring
assets/
models/ — GLB meshes (player jet, enemy jet, drone, missiles)
sounds/
music/ — background loop, level-complete, game-over tracks
sfx/ — WAV files for bullets, explosions, engine, alerts
levels.json — level + wave definitions
| Library | Version | Use |
|---|---|---|
| Three.js | r128 | 3D scene, meshes, camera, GLB loading |
| Tailwind CSS | v4 (CDN) | UI overlays |
No bundler, no transpiler. All scripts loaded via <script> tags in dependency order.
Exercise 4 (Free-style) — From Idea to App, Reichman University, Semester 4. The base project was a 3D ball-runner game. This submission transforms it into a full aerial combat experience.