How haimni/alien_invasion works
Alien Invasion is a Pygame arcade game: the player starts a run, steers a ship, fires at descending alien fleets, and advances through increasingly fast, higher-scoring levels. alien_invasion.py coordinates input, updates, collisions, resets, and rendering; the entity modules implement movement and drawing, while game state and settings support lives, score, and difficulty progression. The scoreboard and play button provide the visible interface. The README describes the game at a high level; the graph follows the sampled runtime source and does not infer additional features.
Main entry points: alien_invasion.py Game loop and rules · settings.py Game settings · ship.py Player ship · alien.py Alien sprites
Components 11
Game control
- Game loop and rules
alien_invasion.py
Game entities
- Player ship
ship.py - Bullet sprites
bullet.py - Alien sprites
alien.py - Ship image
images/ship.bmp - Alien image
images/alien.bmp
State and progression
- Game settings
settings.py - Game statistics
game_stats.py
Interface
- Scoreboard
scoreboard.py - Play button
button.py
Other components
- Player
Connections 15
- Player → Game loop and rules: sends input
- Game loop and rules → Game settings: initializes and adjusts
- Game loop and rules → Game statistics: resets and updates
- Game loop and rules → Player ship: creates and updates
- Game loop and rules → Bullet sprites: creates and updates
- Game loop and rules → Alien sprites: creates and updates
- Game loop and rules → Scoreboard: updates and draws
- Game loop and rules → Play button: checks and draws
- Player ship → Game settings: reads speed
- Bullet sprites → Game settings: reads firing settings
- Alien sprites → Game settings: reads fleet settings
- Scoreboard → Game statistics: reads and records high score
- Scoreboard → Game settings: reads background
- Player ship → Ship image: loads
- Alien sprites → Alien image: loads