How coderaadmi/the-space-shooter-game works
This is a Pygame arcade space shooter. The player starts a run, steers and fires through the game loop, fights enemy ships and meteorites, and sees score, health, and lives; depleted health/lives ends play, with a new high score saved for the game-over screen. The README documents start, pause, resume, mute, and restart screens. The excerpts show the main loop, sprite behavior, and score persistence; some screen and asset details are documented but not fully sampled.
Main entry points: Sprites.py Sprite behaviors · Game.py Game runtime · Settings.py Game settings · png Game sound assets
Components 19
Game control
- Game runtime
Game.py - Game screens
Game.py - Input and events
Game.py - Game loop
Game.py - Collision and scoring
Game.py
Gameplay entities
- Sprite behaviors
Sprites.py - Player ship
Sprites.py - Player and enemy bullets
Sprites.py - Enemy ships
Sprites.py - Meteorites
Sprites.py - Hit and explosion effects
Sprites.py
Display and audio
- Screen rendering
Game.py - Game sound assets
spaceArt/png - Sprite and screen art
spaceArt/png
Settings and records
- Game settings
Settings.py - High score record
Game.py
Other components
- Player
- Pygame display and mixer
- Python shelve
Connections 28
- Player → Game screens: chooses start
- Game screens → Game runtime: starts run
- Game runtime → Game loop: runs
- Player → Input and events: presses controls
- Input and events → Game loop: dispatches events
- Input and events → Game screens: opens pause
- Game loop → Collision and scoring: updates and checks
- Collision and scoring → Sprite behaviors: creates entities
- Collision and scoring → Player ship: changes health and score
- Collision and scoring → Enemy ships: replenishes ships
- Collision and scoring → Meteorites: replenishes meteors
- Sprite behaviors → Player ship: updates sprites
- Sprite behaviors → Player and enemy bullets: updates sprites
- Sprite behaviors → Enemy ships: updates sprites
- Sprite behaviors → Meteorites: updates sprites
- Enemy ships → Player and enemy bullets: fires
- Player ship → Player and enemy bullets: fires
- Sprite behaviors → Hit and explosion effects: creates on removal
- Game loop → Screen rendering: requests drawing
- Screen rendering → Pygame display and mixer: draws and presents
- Game runtime → Pygame display and mixer: initializes display and audio
- Game runtime → Game sound assets: loads sounds
- Sprite behaviors → Sprite and screen art: loads sprite images
- Game runtime → Game settings: reads dimensions and timing
- Sprite behaviors → Game settings: reads dimensions and asset path
- Game screens → High score record: reads high score
- Game screens → Python shelve: loads and saves score
- High score record → Python shelve: persists through