How geluhua/shooting_meteorites works
This is a browser-based Canvas space-shooter. The player starts or restarts a run, moves and aims the ship, fires at falling meteors, and earns combo-multiplied score; collisions can cost lives, and zero lives ends the run. Game is the runtime orchestrator for simulation, state, rendering, audio, and HUD. The README documents the visual effects, meteor splitting, difficulty scaling, and controls. Connections reflect shown Game calls and indexed imports; unsampled modules are represented only where their roles or capabilities are supported.
Main entry points: Game.ts Game loop · math.ts Math helpers · Player.ts Ship state · Bullet.ts Bullet manager
Components 18
Game runtime
- Application entry
src/main.ts - Game loop
src/game/Game.ts
Gameplay simulation
- Input controls
src/game/Input.ts - Ship state
src/game/Player.ts - Bullet manager
src/game/Bullet.ts - Collision checks
src/game/Collision.ts - Meteor lifecycle
src/game/Meteor.ts - Particle system
src/game/Particle.ts - Synth audio
src/game/Audio.ts
Canvas presentation
- Starfield
src/game/Starfield.ts - Score and HUD
src/ui/HUD.ts - Menu and end screen
src/ui/Overlay.ts - Ship rendering
src/render/drawShip.ts - Meteor rendering
src/render/drawMeteor.ts - Visual effects
src/render/effects.ts
Shared utilities
- Math helpers
src/utils/math.ts - Object pool
src/utils/pool.ts
Other components
- Player
Connections 25
- Player → Application entry: opens game
README.md - Application entry → Game loop: imports
src/main.ts - Game loop → Input controls: reads controls
src/game/Game.ts - Game loop → Ship state: updates ship
src/game/Game.ts - Game loop → Bullet manager: updates and draws
src/game/Game.ts - Game loop → Collision checks: checks hits
src/game/Game.ts - Game loop → Meteor lifecycle: spawns and updates
src/game/Game.ts - Game loop → Particle system: updates and draws
src/game/Game.ts - Game loop → Synth audio: plays sounds
src/game/Game.ts - Game loop → Starfield: updates and draws
src/game/Game.ts - Game loop → Score and HUD: updates and draws
src/game/Game.ts - Game loop → Menu and end screen: draws screens
src/game/Game.ts - Game loop → Ship rendering: draws ship
src/game/Game.ts - Game loop → Visual effects: applies effects
src/game/Game.ts - Game loop → Math helpers: chooses spawn position
src/game/Game.ts - Meteor lifecycle → Meteor rendering: delegates drawing
src/game/Meteor.ts - Meteor rendering → Visual effects: uses glow
src/render/drawMeteor.ts - Bullet manager → Object pool: acquires and releases
src/game/Bullet.ts - Bullet manager → Visual effects: uses glow
src/game/Bullet.ts - Collision checks → Math helpers: uses distance checks
src/game/Collision.ts - Input controls → Math helpers: normalizes movement
src/game/Input.ts - Ship state → Input controls: reads controls
src/game/Player.ts - Ship state → Math helpers: clamps position
src/game/Player.ts - Starfield → Math helpers: uses random ranges
src/game/Starfield.ts - Particle system → Object pool: uses pooled objects
src/game/Particle.ts