How tejascodes0110/highway-racer works
Highway Racer is a Pygame lane-dodging game. The player starts or restarts a run, steers between lanes, avoids timed enemy spawns, earns points as enemies leave the screen, and sees a game-over screen with the high score. The controller coordinates gameplay, drawing, and score handling; player and enemy modules implement the main actors. A power-up type exists in the source tree but is not wired into the sampled game loop. The score manager implementation was not sampled, so its storage relationship is uncertain.
Main entry points: main.py Game controller · settings.py Game settings · player.py Player car · enemy.py Enemy cars
Components 8
Game flow
- Game controller
main.py
Road actors
- Player car
player.py - Enemy cars
enemy.py - Power-ups
powerup.py
Configuration and scores
- Game settings
settings.py - High-score manager
score_manager.py - High-score file
highscore.txt
Other components
- Player
Connections 9
- Player → Game controller: sends controls
main.py - Game controller → Player car: creates and updates
main.py - Game controller → Enemy cars: spawns and updates
main.py - Game controller → High-score manager: loads and saves
main.py - Game controller → Game settings: reads configuration
main.py - Player car → Game settings: reads lane and display values
player.py - Enemy cars → Game settings: reads lane and display values
enemy.py - Power-ups → Game settings: reads lane and display values
powerup.py - High-score manager → High-score file: persists scores