Skip to main content

Python game engine featuring a event and data driven archictecture.

Project description

PyGuara Engine

PyGuara is a production-grade, 2D game engine for Python 3.12+. It combines the clean architecture of enterprise software with the fun of game development, featuring a high-performance Entity-Component-System (ECS), a native Dependency Injection (DI) container, and a suite of professional tools.

Status: Alpha (Feature Complete Core). APIs are stable but subject to refinement.

CI codecov Python versions Ruff License

🌟 Why PyGuara?

Most Python game libraries (like Pygame) give you a window and a loop, leaving you to build the "engine" yourself. PyGuara provides that structure out of the box.

  • Structure, not Spaghetti: Built on Dependency Injection and ECS, your code remains decoupled and testable, even as your project grows.
  • Batteries Included: Physics, UI, Pathfinding, Behavior Trees, Tweening, and Tilemaps are all built-in.
  • Developer Experience: Includes a live in-game editor, hot-reloadable config, and robust logging.

🚀 Key Features

  • ⚡ Performance-First ECS:
    • Optimized EntityManager using Inverted Indexes for $O(1)$ queries.
    • Memory-efficient component storage.
  • 🛠️ Professional Tooling:
    • Live Editor: Press F12 to open the hierarchy inspector, modify components in real-time, and save scenes.
    • Debug Tools: Visual gizmos, performance profilers, and event monitors.
  • 🎨 Advanced Rendering:
    • Backend-agnostic pipeline (currently pygame-ce) with automatic Batching and Z-sorting.
    • Camera system with zoom, shake, and multiple viewports.
  • ⚛️ Physics & AI:
    • Native Pymunk integration for rigid bodies, joints, and raycasting.
    • Behavior Trees, Finite State Machines (FSM), and A Pathfinding*.
  • 🖥️ UI System:
    • Constraint-based layout engine (Flexbox-like).
    • Declarative widget composition with theming support.
  • 🎬 Animation & Scripting:
    • Powerful Tweening engine for smooth value transitions.
    • Coroutine system for writing sequential, timed game logic.

📚 Documentation

🛠️ Installation

PyGuara requires Python 3.12 or higher.

Using uv (Recommended)

# Clone the repository
git clone https://github.com/Wedeueis/pyguara
cd pyguara

# Sync dependencies and install
uv sync

Using make

# Clone and enter the repository
git clone https://github.com/Wedeueis/pyguara
cd pyguara

# One command to sync everything (core, dev, docs, benchmarks)
make install

Using pip

pip install -e .[dev]

🎮 Quick Start

To run the engine sandbox and see the features in action:

python main.py

Code Example: A Simple Scene

from pyguara.scene.base import Scene
from pyguara.common.components import Transform
from pyguara.graphics.components import Sprite
from pyguara.physics.components import RigidBody, Collider
from pyguara.common.types import Vector2
from pyguara.graphics.components import Texture

class GameScene(Scene):
    def on_enter(self) -> None:
        # 1. Load Assets
        texture = self.resource_manager.load("player.png", Texture)

        # 2. Create Entity
        player = self.entity_manager.create_entity("Hero")

        # 3. Add Components (Data)
        player.add_component(Transform(position=Vector2(100, 100)))
        player.add_component(Sprite(texture=texture))

        # 4. Add Physics
        player.add_component(RigidBody(body_type=BodyType.DYNAMIC))
        player.add_component(Collider(shape_type=ShapeType.BOX, dimensions=[32, 32]))

🤝 Contributing

Contributions are welcome! Please ensure you adhere to the project's code quality standards.

  1. Run tests: pytest
  2. Lint: ruff check .
  3. Type Check: mypy pyguara

📄 License

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

✍️ Author

Developed by Wedeueis Braz.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyguara-0.3.0.tar.gz (187.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyguara-0.3.0-py3-none-any.whl (267.6 kB view details)

Uploaded Python 3

File details

Details for the file pyguara-0.3.0.tar.gz.

File metadata

  • Download URL: pyguara-0.3.0.tar.gz
  • Upload date:
  • Size: 187.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for pyguara-0.3.0.tar.gz
Algorithm Hash digest
SHA256 21fb443562f053711a621c9594c6d22516df3485fae33c1237522559c56a3284
MD5 54c53ebc573b2b2da11d7dedb5944b8a
BLAKE2b-256 a756a0fef646c335952a938e92d0f062a2dfdf38e485779f1995cff27b5b61e5

See more details on using hashes here.

File details

Details for the file pyguara-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pyguara-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 267.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for pyguara-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94b0e7c05bc917486b417d3a5d4b880e6a0c5c5052225afc76560d51496889bc
MD5 49ba207bc93196dfaedf6333d7538c2d
BLAKE2b-256 931ebb3ce8364555aa2222db7e090b5e51299e44909276848e2c6a9a853ab9d2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page