Getting Started¶
This guide will help you set up your development environment and start working on Ajitroids.
Prerequisites¶
Before you begin, ensure you have the following installed:
- Python 3.9 or higher: Download Python
- Git: Download Git
- uv (recommended) or pip for package management
Installation¶
Option 1: Using uv (Recommended)¶
uv is a fast Python package installer and resolver.
# Clone the repository
git clone https://github.com/Ajimaru/ajitroids.git
cd ajitroids
# Install dependencies
uv install
# Run the game
uv run main.py
Option 2: Using pip¶
# Clone the repository
git clone https://github.com/Ajimaru/ajitroids.git
cd ajitroids
# Create a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run the game
python main.py
Development Setup¶
Installing Development Dependencies¶
For development, you'll need additional tools for testing and code quality:
This installs:
pytest: For running testsblack: For code formattingflake8: For code linting
Installing Documentation Dependencies¶
To build and preview documentation locally:
Running the Game¶
Once installed, you can run the game with:
Or with uv:
Project Structure¶
ajitroids/
├── main.py # Entry point
├── modul/ # Game modules
│ ├── player.py # Player ship logic
│ ├── asteroid.py # Asteroid logic
│ ├── boss.py # Boss enemy logic
│ ├── powerup.py # Power-up system
│ ├── menu.py # Menu system
│ ├── sounds.py # Sound management
│ ├── achievements.py # Achievement system
│ └── ...
├── assets/ # Game assets (images, sounds)
├── tests/ # Test files
├── docs/ # Documentation
└── requirements.txt # Python dependencies
Running Tests¶
Run the test suite with pytest:
For verbose output:
To run specific tests:
Code Quality¶
Formatting Code¶
Format your code with black:
Linting Code¶
Check code quality with flake8:
Building Documentation¶
To build and serve the documentation locally:
Then open your browser to http://127.0.0.1:8000/
Next Steps¶
- Read the Architecture Overview to understand the codebase
- Check out the Contributing Guide to start making changes
- Explore the Python API for detailed code documentation
Common Issues¶
Pygame Installation Issues¶
If you encounter issues installing Pygame, especially on Linux, you may need to install SDL dependencies:
Ubuntu/Debian:
macOS:
Sound Issues¶
If you don't hear any sound:
- Check your system volume
- Ensure audio output device is properly configured
- Try adjusting sound settings in the game menu
Getting Help¶
If you run into problems:
- Check the Issue Tracker
- Read through existing issues to see if someone else has encountered the same problem
- Create a new issue with detailed information about your problem