Asteroids Game
A classic arcade-style Asteroids game built using Python and Pygame — demonstrating object-oriented design, sprite management, and real-time gameplay mechanics.
Features
-
Player-controlled spaceship with smooth rotation and movement controls.
-
Shooting mechanics with cooldown, firing projectiles to destroy asteroids.
-
Asteroid spawning and splitting: Large asteroids break into smaller ones upon being shot.
-
Collision detection: Player loses upon collision with asteroids.
-
Vector-based physics: Smooth movement and velocity handling using pygame.Vector2.
-
Modular, extensible code leveraging inheritance and sprite groups.
Controls
-
W/S: Move forward/backward
-
A/D: Rotate left/right
-
Spacebar: Shoot projectiles
Technologies
-
Python 3.x
-
Pygame library for game loop, rendering, and input handling
Project Structure
-
main.py — game loop and initialization
-
player.py — player ship implementation
-
asteroid.py — asteroid behavior and splitting logic
-
asteroidfield.py — asteroid spawning and management
-
shot.py — projectile logic
-
circleshape.py — base class for circular game objects
-
constants.py — game constants and settings