Skip to content

heysmtk/asteroids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

29 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿช Asteroids

A simple clone of the classic Asteroids arcade game built with Pygame. Control your ship, avoid collisions, and shoot asteroids to survive!

screenshot

๐Ÿš€ Features

  • Player ship with rotation and movement
  • Asteroids that spawn randomly from the screen edges
  • Shooting mechanic with cooldown
  • Asteroids split into smaller pieces when shot
  • Basic collision detection and game over logic
  • Clean object-oriented structure using Pygame's Sprite system

๐ŸŽฎ Controls

Key Action
W Move forward
S Move backward
A Rotate left
D Rotate right
Space Shoot

๐Ÿงฑ Structure

asteroids/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ main.py            # Game loop and main logic
โ”‚   โ”œโ”€โ”€ player.py          # Player logic and drawing
โ”‚   โ”œโ”€โ”€ asteroid.py        # Asteroid behavior and splitting
โ”‚   โ”œโ”€โ”€ asteroidfield.py   # Spawning new asteroids
โ”‚   โ”œโ”€โ”€ shot.py            # Player bullets
โ”‚   โ”œโ”€โ”€ circleshape.py     # Base class for circular objects
โ”‚   โ””โ”€โ”€ constants.py       # Game settings and constants
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ README.md

๐Ÿ› ๏ธ Installation

Clone the repository:

git clone https://github.com/heysmtk/asteroids.git
cd asteroids

Create a virtual environment (optional but recommended):

python -m venv venv
source venv/bin/activate

Install dependencies:

pip install -r requirements.txt

Run the game:

python -m src.main

๐Ÿ’ก Make sure you're using Python 3.11+ and have Pygame installed.

๐Ÿง  Future Ideas

  • Add score tracking
  • Implement player lives and respawn system
  • Add sound effects and music
  • Create a start menu and game over screen

๐Ÿ“„ License

MIT โ€“ do whatever you want, just have fun ๐Ÿš€

  • Made with โค๏ธ by @heysmtk

About

Guided project from boot.dev, asteroids game.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages