Skip to content

๐Ÿš€ A Python-based Asteroids game clone for practicing object-oriented programming and game design fundamentals.

Notifications You must be signed in to change notification settings

heinrichb/bootdotdev_asteroids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Asteroids Game (Python)

This repository contains the Asteroids Game project, developed as part of the Boot.dev course. This project recreates the classic arcade experience of navigating a spaceship, shooting asteroids, and avoiding collisions.


๐ŸŒŸ Features

  • Player Movement: Control the spaceship with fluid movement mechanics.
  • Shooting Mechanics: Destroy asteroids with precise shooting.
  • Asteroid Dynamics: Randomly generated and splitable asteroids for endless gameplay.
  • Scoring System: Keep track of your progress with a live score counter.
  • Game Over: Immersive game over screen with the final score and objects frozen in their last positions.

๐Ÿ› ๏ธ Technologies Used

  • Python: Core programming language.
  • Pygame: Library used for game development.
  • Random Module: For asteroid generation and movement dynamics.
  • Unit Testing: Ensures reliability and correctness of gameplay mechanics.

๐Ÿ“š What I Learned

  • Game Development Fundamentals: Built a structured game loop and managed game states.
  • Entity Interactions: Implemented collision detection and event-based interactions.
  • Code Modularity: Organized the code into reusable modules and utilities.
  • Testing Practices: Wrote unit tests for game entities and mechanics.

๐Ÿงช Testing

This project includes comprehensive unit tests to ensure the reliability of the following:

  • Player Mechanics: Movement, shooting, and interactions.
  • Asteroid Behavior: Random spawning, splitting, and collisions.
  • Game Logic: Scoring updates and game over conditions.

To run tests, simply execute:

pytest

๐Ÿ“‚ Project Structure

src/
โ”œโ”€โ”€ __main__.py        # Entry point for the game
โ”œโ”€โ”€ asteroids/         # Core game modules
โ”‚   โ”œโ”€โ”€ entities/      # Game entities like player, asteroid, and shots
โ”‚   โ”œโ”€โ”€ utils/         # Helper utilities (e.g., rendering functions)
โ”‚   โ”œโ”€โ”€ constants.py   # Shared game constants
tests/                 # Unit tests for validating game functionality

๐ŸŒŒ Why This Project?

The Asteroids Game was an opportunity to explore:

  • The fundamentals of game development.
  • Pythonโ€™s capabilities for creating interactive 2D applications.
  • Problem-solving through implementing classic arcade mechanics.

๐Ÿ”— Related Resources


Ready to navigate the asteroid field? Clone the repository and give it a try! ๐ŸŽฎ

About

๐Ÿš€ A Python-based Asteroids game clone for practicing object-oriented programming and game design fundamentals.

Topics

Resources

Stars

Watchers

Forks