A collection of practical examples demonstrating audio, graphics, and game development with Raylib and pyray in Python, with PyGLM for vector/matrix math in advanced rendering examples.
- 📦 Multiple example categories: Audio, textures, input, and more
- 🎯 Modern Python: Type hints, dataclasses, and Python 3.14 best practices
- 🧮 GLM math support: Uses PyGLM for vector/matrix math in advanced shader examples
- ✅ Validated code: All examples pass
mypytype checking andblackformatting - 🔧 Easy setup: Single venv and pip install
- Python 3.10 or higher
- pip (usually included with Python)
- PyGLM (installed via
requirements.txt)
# Clone the repository
git clone https://github.com/PurpBatBoi/raylib-python-examples.git
cd raylib-python-examples
# Create and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtAfter activation, run any example:
python main.py
python AUDIO/audio_module_playing.py
python AUDIO/audio_sound_positioning.pyBrowse the repository structure to explore all available examples by category.
Install dev dependencies and run validation:
pip install -r requirements-dev.txt
# Format code
python -m black AUDIO/audio_module_playing.py
# Type check
python -m mypy AUDIO/audio_module_playing.py
# Check all files
python -m mypy $(find . -name "*.py" -not -path "./.venv/*")
python -m black --check $(find . -name "*.py" -not -path "./.venv/*")This project follows a comprehensive style guide. See STYLE_GUIDE.md for detailed conventions including:
- pyray API usage
- Type hint requirements
- Python 3.14 best practices
- Code formatting and validation rules
Contributions are welcome! Please ensure all code:
- Follows the style guide in STYLE_GUIDE.md
- Passes
mypytype checking - Is formatted with
black - Includes appropriate docstrings
- Uses pyray APIs for primary examples
This project is licensed under the zlib License. See LICENSE.
These examples are Python ports of the original raylib C examples. Original raylib examples and assets remain credited to their respective authors.
AI use disclosure: AI agents were used as an implementation, refactoring aid and experimentation purposes.