Asteroids game in Python
To follow best practice, I recommend using a virtual environment (venv) to keep the Python version of each library needed for this project separate from other Python projects.
- To create one (venv) (at the top level of your project directory) use this code
python3 -m venv venv
- Activate the (venv) with this code
source venv/bin/activate
- Install the requirements
pip install -r requirements.txt
- Check the pygame is installed:
python3 -m pygame
Once you have finished playing and closed the terminal, if you want to play again just remember to re-enable the virtual environment (
source venv/bin/activate
) before executing main.py
- Install the requirements
pip install -r requirements.txt
- Run the game with
python3 main.py
- Use arrow keys or W/A/S/D for move the Spaceship
- Press space bar to shoot
- pygame: https://www.pygame.org/docs/ref/pygame.html
- Style Guide for Python Code: https://peps.python.org/pep-0008/#imports