Skip to content

benjaminwilcox/pygame-asteroid

Repository files navigation

Asteroids Game

A classic Asteroids arcade game remake built with Python and Pygame.

image

Description

Navigate your spaceship through an asteroid field, shooting asteroids to survive and rack up points. Asteroids split into smaller pieces when hit, creating an increasingly challenging gameplay experience.

Features

  • Classic asteroids gameplay mechanics
  • Progressive difficulty as asteroids split
  • Score tracking
  • Smooth controls and physics
  • Continuous asteroid spawning

Controls

  • W - Move forward
  • S - Move backward
  • A - Rotate left
  • D - Rotate right
  • SPACE - Shoot

Installation

  1. Clone the repository:
git clone <your-repo-url>
cd pygame-asteroid
  1. Create a virtual environment (recommended):
python -m venv .venv
source .venv/bin/activate
  1. Install dependencies:
pip install pygame

Or if using uv:

uv sync

Running the Game

python main.py

Requirements

  • Python 3.12+
  • Pygame 2.6.1

How to Play

  • Avoid colliding with asteroids - one hit and it's game over!
  • Shoot asteroids to break them into smaller pieces
  • Smaller asteroids are worth the same points but harder to hit
  • See how high you can score!

Project Structure

  • main.py - Game loop and main logic
  • player.py - Player spaceship class
  • asteroid.py - Asteroid class and splitting behavior
  • shot.py - Bullet/projectile class
  • circleshape.py - Base class for circular game objects
  • asteroidfield.py - Asteroid spawning system
  • constants.py - Game configuration and constants

Credits

The base of this project was built following the Build Asteroids with Python course from Boot.dev. Scoring system was additionally added.

License

This project is open source and available for educational purposes.

About

A classic Asteroids arcade game remake built with Python and Pygame.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages