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.
- 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.
- 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.
- 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.
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
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
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.
Ready to navigate the asteroid field? Clone the repository and give it a try! ๐ฎ