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.1.0.tar.gz (19.4 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.1.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ludos-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8efb53d7c1108aa801d176454f11b2a7433790e25459a1e44ef1041cf2b8ddee
MD5 a8da6ca98f92cab86fc0f584d299c66a
BLAKE2b-256 10e34a53c7fb4fab0397d9f9696665d800dbe008d9380fbc6b845d8d6422bba6

See more details on using hashes here.

Provenance

The following attestation bundles were made for ludos-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: ludos-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 326c72e51fad82000bb16c19fa8fefdc394a2627201fa8c29b1106d9d94e3ab4
MD5 92243b7c18d7e2dd387895b997c4968f
BLAKE2b-256 e97dfdabea54789c6d48d95c2946df5428bb101b10b27b7962f64b9b93c918e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for ludos-0.1.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