A small 2D arcade game written with Pygame: drive the car left and right and dodge the falling blocks. Every block you pass raises your score, and the blocks fall faster every 5 points. Hitting a block or the edge of the road ends the run.
- Start menu with clickable Play / Quit buttons
- Increasing difficulty: obstacle speed goes up every 5 blocks dodged
- Background music and a crash sound effect
- Live "Dodged" score counter
Requires Python 3.8+.
git clone https://github.com/ariaesm/pygame.git
cd pygame
pip install -r requirements.txt
python race_car.py| Key | Action |
|---|---|
| ← / → | Move the car |
| Mouse | Click the menu buttons |
race_car.py # game loop, rendering, collision detection
assets/
car.png # player sprite
music.ogg # background music
crash.wav # crash sound
The game runs a classic loop at 60 FPS: read input → update the car and obstacle positions → check for collisions with simple rectangle overlap → redraw the screen. When the obstacle leaves the screen it respawns at a random x position and the score goes up; every fifth point the fall speed increases.