Game rules
Collect stars to gain points. Yellow stars give a small boost, blue stars are worth more. The longer you survive, the faster everything moves.
Meteors drain your lives—three hits and the run ends. Use the HUD to track score, best score for this session, and remaining lives.
Controls
- Keyboard: Arrow keys or WASD to move.
- Touch: Use the on-screen arrows on mobile devices.
- Pause / resume: Click the Play again button after a game over to restart instantly.
About this project
Astro Collector is intentionally small and approachable. It uses a single HTML5 canvas and plain JavaScript modules—no frameworks, no build step. The source is organized by page (HTML), styling (CSS), and behavior (JS) to be easy to study.
The highscores page demonstrates simple REST interactions with graceful error handling. You can experiment with different endpoints in js/api.js.