How sronaldooo/dodge-the-meteors works
Dodge the Meteors is a small browser survival game. Players start or resume a run, steer the ship with keyboard controls, avoid increasingly frequent falling meteors, and survive to build a score; collisions end the run and update the browser-stored best score. Pause and restart are additional controls. The sampled JavaScript combines game state, simulation, collision handling, drawing, and event wiring in one file, so these are shown as responsibilities within that runtime rather than separate modules. HTML and styling are present in the tree, but their implementation was not sampled.
Main entry points: script.js Game controller
Components 6
Game runtime
- Game controller
script.js - Survival simulation
script.js - Canvas renderer
script.js
Scores and persistence
- Score state
script.js - Browser storage
Other components
- Player
Connections 7
- Player → Game controller: starts, pauses
script.js - Player → Survival simulation: steers ship
script.js - Game controller → Survival simulation: updates
script.js - Game controller → Canvas renderer: draws frame
script.js - Survival simulation → Score state: increments
script.js - Game controller → Score state: resets, checks
script.js - Score state → Browser storage: reads, writes best
script.js