How shreyaskumbhar4-hub/space-dodge-game works
Space Dodge is a single-file Pygame game: the player steers a ship to avoid falling asteroids, earns points by surviving, and can restart after a collision. The main loop coordinates movement, spawning, scoring, collision effects, and drawing. A local JSON file stores the high score. All game behavior is in main.py; the wiring shown is based on the sampled source.
Main entry points: main.py Game loop
Components 9
Other components
- Player
- Game loop
main.py - Movement
main.py - Asteroids and scoring
main.py - Collision and effects
main.py - Rendering and UI
main.py - High score handling
main.py - High score JSON
- Pygame
Connections 11
- Player → Game loop: gives input
- Game loop → Movement: updates position
- Game loop → Asteroids and scoring: spawns and updates
- Game loop → Collision and effects: checks collision
- Game loop → Rendering and UI: draws frame
- Game loop → High score handling: loads and saves
- Collision and effects → Asteroids and scoring: checks overlap
- Collision and effects → Pygame: plays sound
- High score handling → High score JSON: reads and writes
- Movement → Pygame: reads keys
- Rendering and UI → Pygame: draws and displays