Skip to main content

A lightweight 2D runtime built on top of pygame-ce.

Project description

Guigine

Guigine is a lightweight 2D runtime built on top of pygame-ce.

It is meant for small and medium 2D games, gameplay prototypes, menu-heavy applications, and projects that benefit from scenes, ECS, resource loading, and simple rendering without carrying a large engine framework.

Install

If you want the library:

pip install guigine

If you mainly want the project generator CLI:

pipx install guigine

Both installation modes expose the guigine command on Windows, Linux, and macOS.

CLI Quick Start

Create a new starter project:

guigine new my_game

Or, for backward compatibility with the original command shape:

guigine my_game

Remove a generated project:

guigine remove my_game

The generated project includes:

  • a local guigine/ engine copy
  • an assets/ folder
  • a src/<project_name>/main.py entry point
  • a starter README.md
  • Poetry and taskipy commands for running and testing

Contributor Setup

Clone the repository and install dependencies with Poetry:

poetry install

Run the full test suite:

poetry run task test

Run only the CLI-focused tests:

poetry run task test-cli

Run the example showcase from the repository:

poetry run task run-examples

What Guigine Includes

  • EngineApp runtime bootstrap
  • scene management with fade transitions
  • shared SceneContext
  • lightweight ECS primitives
  • 2D camera support
  • physics and collision helpers
  • resource loading for images, fonts, and sounds
  • audio and music managers
  • reusable widgets
  • optional TMX map loading
  • TMX entity spawning helpers
  • automated tests for core runtime systems

Package Layout

Repository structure:

Guigine/
|- guigine/
|- examples/
|- tests/
|- pyproject.toml
\- README.md
  • guigine/ contains the reusable runtime package published to PyPI.
  • examples/ contains repository-only examples and assets.
  • tests/ contains the automated suite used during development.

The bash/ folder is kept only for local compatibility wrappers and is excluded from published package artifacts.

Minimal Example

from pathlib import Path

from guigine.app.app import EngineApp
from guigine.app.config import EngineConfig
from guigine.scene.base_scene import BaseScene


class DemoScene(BaseScene):
    def __init__(self, context):
        super().__init__(context, world_width=1280, world_height=720)

    def process_input(self, events):
        _ = events

    def update(self, dt):
        _ = dt

    def render(self):
        self.screen.fill((20, 24, 30))


def main() -> None:
    app = EngineApp(
        EngineConfig(
            title="My Game",
            width=1280,
            height=720,
            asset_root=Path("assets"),
        )
    )
    app.register_scene("demo", lambda context: DemoScene(context))
    app.start("demo")
    app.run()


if __name__ == "__main__":
    main()

ECS Example

from guigine.components.base import Position, Velocity
from guigine.components.collider import Collider


player = self.entity_manager.create(
    Position(100, 100),
    Velocity(),
    Collider(16, 16),
)

TMX Example

from guigine.map.tile_map_loader import TileMapLoader


loader = TileMapLoader(self.resources, walk_layer_name="ground2")
tilemap = loader.load("maps/level_01.tmx")

Notes For Publishing

  • The PyPI package exposes the guigine command through a Python entry point.
  • The local bash/ wrappers are not part of the published package.
  • The repository examples are documentation/reference material and are not installed as part of the runtime package.

Current Status

Guigine is currently best treated as an early reusable runtime for experimentation, tooling, and game prototypes. The public API is small on purpose and should evolve carefully as more real projects adopt it.

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

guigine-0.1.0.tar.gz (25.4 kB view details)

Uploaded Source

Built Distribution

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

guigine-0.1.0-py3-none-any.whl (45.8 kB view details)

Uploaded Python 3

File details

Details for the file guigine-0.1.0.tar.gz.

File metadata

  • Download URL: guigine-0.1.0.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.12.0rc2 Windows/11

File hashes

Hashes for guigine-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4d8befe2c4ab54ef63c960c9837976a33374dc3cf8c6b416516c662ba5ee1333
MD5 9f7bb69b0b132b02df4a9164f2b1c999
BLAKE2b-256 5e4e1060e46d65a262f6d23781da2cea275fcc3b268f2336e92bf029c2b2806a

See more details on using hashes here.

File details

Details for the file guigine-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: guigine-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 45.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.12.0rc2 Windows/11

File hashes

Hashes for guigine-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0efdc0d30e9f32b18f970f39ebd2679367a553ec243faf9d6ce2bd9de05e9cb7
MD5 2e05c665f93bc2aa7d679c40296534dc
BLAKE2b-256 29c1b56b6e0d0f8056e4a159dfc6c5da8bf95d47ef3c45ca1fda85cfb76e8fe5

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