A high-level 2D game framework for Python (on top of pygame). Desktop, web and mobile from one codebase.
pip install spriteproFor mobile: pip install "spritepro[kivy]"
Project template: python -m spritePro.cli --create (minimal: --create --simple)
pip install --upgrade spritepro| What you usually do | In SpritePro |
|---|---|
| Hand-written game loop | s.run(scene=...) — scene + auto-render |
| Your own camera | Camera API, follow, zoom, shake |
| UI from scratch | Button, ToggleButton, TextSprite, Slider, TextInput, Layout |
| Physics kept separate | pymunk integration, body types, collisions |
| Visual editor | Sprite Editor → JSON → spawn_scene(...) |
| Parsing saves by hand | PlayerPrefs → JSON |
| Multiplayer from scratch | TCP, lobby, ChatScene, sync |
| Mobile as a separate thing | platform="kivy" — same logic |
| Scrollable UI | ScrollView + ClipMask — clipping that already works |
SpritePro = pygame + physics, Layout, ScrollView, ClipMask, scene editor, multiplayer, UI.
import spritePro as s
class MainScene(s.Scene):
def __init__(self):
super().__init__()
self.player = s.Sprite("", (50, 50), s.WH_C, speed=5, scene=self)
def update(self, dt):
self.player.handle_keyboard_input()
s.run(scene=MainScene, size=(800, 600), title="My Game")That's it: window, scene, game loop, controls.
- Sprite — the base class, with movement, effects and a parent-child hierarchy
- UI: Button, ToggleButton, Slider, TextInput, TextSprite, Layout (flex/grid/circle/line)
- ClipMask — a clipping mask for viewports, inventories, chats
- ScrollView — scrollable content with a wheel and drag-and-drop
- Physics: pymunk, DYNAMIC/STATIC/KINEMATIC bodies, collisions
- Animations: Tween, Fluent API (
DoMove,DoScale,SetEase...) - Particles: ParticleEmitter, presets, pools
- Multiplayer: TCP, lobby, ChatScene, sync
- Audio: sound and music
- Save/Load: PlayerPrefs as JSON
- Sprite Editor: build scenes visually → JSON
A visual scene editor with a hierarchy, an inspector and gizmos.
python -m spritePro.cli --editor
Build a scene → save it as JSON → load it in the game:
rt = spawn_scene("level.json", scene=self)
player = rt.exact("player").Sprite(speed=5)A ready-made chat scene with a clipping mask and scrolling:
from spritePro.readyScenes import ChatScene, ChatStyle
import spritePro as s
s.run(scene=ChatScene, multiplayer=True, multiplayer_use_lobby=True, title="Chat")| Feature | pygame | arcade | SpritePro |
|---|---|---|---|
| Auto-render | ❌ | ✅ | ✅ |
| Ready-made camera | ❌ | ✅ | ✅ |
| Physics (pymunk) | ❌ | ✅ | ✅ |
| Layout (flex/grid) | ❌ | ❌ | ✅ |
| Scene editor (JSON) | ❌ | ❌ | ✅ |
| Clipping mask / ScrollView | ❌ | ❌ | ✅ |
| Multiplayer (TCP) | ❌ | ❌ | ✅ |
| PlayerPrefs | ❌ | ❌ | ✅ |
- Platformers, arcades, RPGs
- Puzzles, tower defense
- Multiplayer games
- Mobile games (
platform="kivy")
python -m spritePro.demoGames.physics_demo # physics
python -m spritePro.demoGames.fluent_tween_demo # tweens
python -m spritePro.demoGames.layout_demo # layouts
python -m spritePro.demoGames.local_multiplayer_demo --quickA multiplayer clone of Slither.io and the reference networked game on SpritePro: host-authoritative food and bots, actions confirmed by the host, joining mid-game. Architecture walkthrough in ARCHITECTURE.md.
# single player
python spritePro/demoGames/slisario_andrulok/main.py --single
# local: host + client, two windows
python spritePro/demoGames/slisario_andrulok/main.py --quickMore: spritePro/demoGames/slisario_andrulok/README.md
s.run(scene=MainScene, platform="kivy") # Android/iOSpython -m spritePro.cli --android . --android-orientation portraitWeb: docs/builds/building_web.md
| What | Where |
|---|---|
| Full index | DOCUMENTATION_INDEX.md |
Table of contents for docs/ |
docs/README.md |
| API Reference | docs/API_REFERENCE.md |
| For beginners | docs/GETTING_STARTED.md |
| Physics | docs/core/physics_guide.md |
| UI/Layout | docs/ui/layout_ui.md |
| ClipMask | docs/ui/clip_mask.md |
| Multiplayer | docs/systems/networking_guide.md |
| Sprite Editor | docs/editor/sprite_editor.md |
| Mobile | docs/builds/mobile_kivy.md |
- CONTRIBUTING.md — how to contribute
- ROADMAP.md — roadmap
- CHANGELOG.md — changelog
