Skip to the content.

PyG Engine

A Python game engine built on Pygame and Pymunk for 2D physics, rendering, and game development. Built around scriptable game objects, rigidbody and collider system. Contains physics materials, update system, event system and mouse+keyboard input system

NOTE: This is in alpha development stage. Everything is under active development and large changes will likely be made. Also, its pronounced pig engine :)

Features

🎮 OOP Model

Simple game object implementation system

⚡ 2D Physics

Built-in physics via Pymunk

🖱️ Input

Mouse, keyboard, and joystick input handling

🧩 Components

Modular component-based architecture

📜 Scripts

Dynamic script loading and execution

📷 Camera

Flexible camera with multiple scaling modes

📡 Event System

Thread-safe event-driven communication with priority-based handling

📚 Documentation

Comprehensive CORE_SYSTEMS_GUIDE with examples and best practices

Quick Start

from pyg_engine import Engine, GameObject, Size
from pygame import Color, Vector2

# Create the engine
engine = Engine(
    size=Size(w=800, h=600),
    backgroundColor=Color(0, 0, 0),
    windowName="My Game"
)

# Create a game object
player = GameObject(
    name="Player",
    position=(400, 300),
    size=(50, 50),
    color=Color(255, 0, 0)
)

# Add to engine
engine.addGameObject(player)

# Start the game loop
engine.start()

🚀 Installation

Requires Python 3.7+

Dependencies:

Install via pip:

pip install pyg-engine

Or install from source:

git clone <repository-url>
cd pyg-engine
pip install -e .

Documentation

Check out our comprehensive 📖 Core Systems Guide for detailed documentation on all features and systems.

Examples

The project includes numerous examples demonstrating various features: 🚀 View All Examples

Contributing

We welcome contributions! Please check out the 🐙 GitHub Repository for more information.

License

This project is licensed under the MIT License - see the 📄 LICENSE file for details.

🎮 Ready to build amazing games?

Start with PyG Engine today and bring your game ideas to life!

📖 Get Started 🚀 View Examples