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
BaseGameStateas a dataclass, mutate throughStateManager.update() - Scene stack — Push/pop/replace scenes with
on_enter/on_exitlifecycle hooks - Input mapping — Map raw pygame keys to semantic actions via
KeyBindings - Display wrapper —
Windowhandles pygame display init and surface management - Built-in menu —
MenuScenewith configurableMenuConfigfor quick prototyping - Error hierarchy — All errors inherit
LudosErrorfor unified catching
Documentation
See the user guide for full documentation.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8efb53d7c1108aa801d176454f11b2a7433790e25459a1e44ef1041cf2b8ddee
|
|
| MD5 |
a8da6ca98f92cab86fc0f584d299c66a
|
|
| BLAKE2b-256 |
10e34a53c7fb4fab0397d9f9696665d800dbe008d9380fbc6b845d8d6422bba6
|
Provenance
The following attestation bundles were made for ludos-0.1.0.tar.gz:
Publisher:
publish.yml on mclarkelauer/ludos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ludos-0.1.0.tar.gz -
Subject digest:
8efb53d7c1108aa801d176454f11b2a7433790e25459a1e44ef1041cf2b8ddee - Sigstore transparency entry: 954908921
- Sigstore integration time:
-
Permalink:
mclarkelauer/ludos@cd677311d4d483efb312e50231b0b7d8e529b74f -
Branch / Tag:
refs/tags/v.0.1.1 - Owner: https://github.com/mclarkelauer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cd677311d4d483efb312e50231b0b7d8e529b74f -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
326c72e51fad82000bb16c19fa8fefdc394a2627201fa8c29b1106d9d94e3ab4
|
|
| MD5 |
92243b7c18d7e2dd387895b997c4968f
|
|
| BLAKE2b-256 |
e97dfdabea54789c6d48d95c2946df5428bb101b10b27b7962f64b9b93c918e9
|
Provenance
The following attestation bundles were made for ludos-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on mclarkelauer/ludos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ludos-0.1.0-py3-none-any.whl -
Subject digest:
326c72e51fad82000bb16c19fa8fefdc394a2627201fa8c29b1106d9d94e3ab4 - Sigstore transparency entry: 954908930
- Sigstore integration time:
-
Permalink:
mclarkelauer/ludos@cd677311d4d483efb312e50231b0b7d8e529b74f -
Branch / Tag:
refs/tags/v.0.1.1 - Owner: https://github.com/mclarkelauer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cd677311d4d483efb312e50231b0b7d8e529b74f -
Trigger Event:
push
-
Statement type: