Skip to main content

Pygame abstraction framework for rapid game development

Project description

Ludos

Pygame-ce abstraction framework that eliminates boilerplate for rapid game development. Clean separation between input, state, and rendering with extensibility at every layer.

Install

pip install ludos

Quick Start

from dataclasses import dataclass
import pygame
from ludos import (
    BaseGameState, BaseScene, EngineConfig, GameEngine,
    KeyBindings, SceneManager, StateManager,
)

@dataclass
class MyState(BaseGameState):
    score: int = 0

class PlayScene(BaseScene):
    def handle_input(self, events, state_manager):
        pass

    def update(self, dt, state_manager):
        pass

    def render(self, surface, state_manager):
        surface.fill((0, 0, 0))

config = EngineConfig(title="My Game", width=800, height=600)
state_manager = StateManager(MyState())
scene_manager = SceneManager()
scene_manager.push(PlayScene())

engine = GameEngine(config)
engine.run(scene_manager, state_manager)

Features

  • State management — Subclass BaseGameState as a dataclass, mutate through StateManager.update()
  • Scene stack — Push/pop/replace scenes with on_enter/on_exit lifecycle hooks
  • Input mapping — Map raw pygame keys to semantic actions via KeyBindings
  • Display wrapperWindow handles pygame display init and surface management
  • Built-in menuMenuScene with configurable MenuConfig for quick prototyping
  • Error hierarchy — All errors inherit LudosError for unified catching

Documentation

See the user guide for full documentation.

License

MIT

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

ludos-0.2.0.tar.gz (74.8 kB view details)

Uploaded Source

Built Distribution

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

ludos-0.2.0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file ludos-0.2.0.tar.gz.

File metadata

  • Download URL: ludos-0.2.0.tar.gz
  • Upload date:
  • Size: 74.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ludos-0.2.0.tar.gz
Algorithm Hash digest
SHA256 00b311c8289774b2c10d6177dda57909e99467a10928bac39c5462f7e2210d4e
MD5 965ba8d6bcdb359ca98b62ec5ab1a54d
BLAKE2b-256 1527a06aaa7785f8c3f3cd334b1a2df095daa250e4ee31a8ef281290276995ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for ludos-0.2.0.tar.gz:

Publisher: publish.yml on mclarkelauer/ludos

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ludos-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ludos-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ludos-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 45b636e05b01859f2bf16aae3cb6506bd2d5c8b5312b34894890c4f9cdfcf7b4
MD5 1a9179271787f4eb4b5cc69a30be1438
BLAKE2b-256 dfd9dddbfad95dde0d12a2a759933255980423c45bbcce774fc09ac4bb6483b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for ludos-0.2.0-py3-none-any.whl:

Publisher: publish.yml on mclarkelauer/ludos

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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