Asteroid Drift Inefy interactive lab / Vector run
Game guide

Asteroid Drift

Canvas Asteroids-style loop with thrust, rotation, shooting, shields, randomized spawns, collisions, waves, scoring, and touch controls.

  • Canvas vector rendering
  • Shared keyboard/touch input
  • Wave spawning and scoring
  • Shield and cooldown systems
Status
Polished prototype / live demo
Last updated
May 2026
Back to Interactive Lab
Controls
Rotate, thrust, fire charged shots, and shield near collisions.
Keyboard
Arrow/WASD move, Space/Enter fires, Shift/S shields, P/Escape pauses, R restarts.
Touch
Hold Left/Right/Thrust, tap Fire, and hold Shield while energy drains.
Scoring
Asteroids score by size, wave clears add bonuses, and best score saves locally.
Accessibility
Score, wave, lives, shield, charge, and status text are exposed outside the canvas for nonvisual game state.
Score 0
Best 0
Wave 1
Lives 3
Shield 100%

Ready

Asteroid Drift ready.

Outer belt
Blaster
Ready
Control reference

Keyboard and touch controls

Keyboard shortcuts

  • Left / ARotate the ship left while held.
  • Right / DRotate the ship right while held.
  • Up / WHold thrust to build momentum.
  • Space / EnterFire when playing, or launch from the menu.
  • Shift / SHold the shield while energy is available.
  • P / Esc / RPause or resume with P/Esc; restart with R.

Touch controls

  • Left / RightHold to rotate the ship.
  • ThrustHold to move forward and build drift.
  • FireTap for shots when the blaster is charged.
  • ShieldHold to absorb close hits while shield energy drains.

Touch controls: hold rotation/thrust, tap Fire, hold Shield for close calls.

Scoring and progression

A focused arcade loop with readable risk and reward.

Wave pressure

Each wave adds asteroids; clearing the field advances the run.

Scoring model

Hits score by asteroid size, wave clears add bonuses, and best score persists.

Survival tools

Lives, shield energy, and blaster charge keep risk readable.

Implementation notes

Movement, shooting, collision, shield, and spawning systems.

Movement model

The ship uses rotation, thrust, drag, speed clamping, and screen wrapping for inertia without a physics library.

Shooting cadence

Bullets inherit ship position/direction, expire quickly, and use a HUD cooldown.

Collision checks

Impacts use radius checks, split large rocks, and update score, lives, particles, and waves.

Shield behavior

Shield drains while active, recharges when released, and can absorb a crash.

Spawning rules

Asteroids spawn from screen edges with randomized heading, speed, spin, and shape.

Input architecture

Keyboard and touch write into one input state.

What I built

Arcade movement, wave state, and keyboard/touch combat controls.

Asteroids-style mechanics are an established genre reference; this browser implementation, visuals, and state loop are custom JavaScript.

Production readiness

Polished prototype with release hardening still ahead.

Solid: movement, shooting, shields, spawns, collisions, waves, HUD, best score, and keyboard/touch. Hardening: collision tests, difficulty tuning, mobile QA, profiling, and richer nonvisual status.

Deployment and run notes

Static canvas game with local browser state.

GitHub Pages serves asteroid-drift.html, asteroid-drift.css, and asteroid-drift.js. No env vars or external APIs beyond browser APIs and LocalStorage. Local: run python -m http.server 8000 and open /asteroid-drift.html.

Keep exploring

More canvas game loops

Compare real-time input and collisions with the other demos and main case studies.