Skip to main content

A high-level cross-platform 2D game framework for Python with desktop, web, and mobile workflows.

Project description

SpritePro

Высокоуровневый 2D game framework на Python (поверх pygame). Desktop, web и mobile из одной кодовой базы.

Python License Version

Demo


Установка

pip install spritepro

Для mobile: pip install "spritepro[kivy]"

Шаблон проекта: python -m spritePro.cli --create

Обновление

pip install --upgrade spritepro

Почему SpritePro

Обычно приходится В SpritePro
Ручной игровой цикл s.run(scene=...) — сцена + auto-render
Своя камера Camera API, follow, zoom, shake
UI с нуля Button, ToggleButton, TextSprite, Slider, TextInput, Layout
Физика отдельно pymunk-интеграция, типы тел, коллизии
Визуальный editor Sprite Editor → JSON → spawn_scene(...)
Сохранения парсить PlayerPrefs → JSON
Мультиплеер с нуля TCP, лобби, ChatScene, синхронизация
Mobile отдельно platform="kivy" — та же логика
Скроллируемый UI ScrollView + ClipMask — готовый клиппинг

SpritePro = pygame + физика, Layout, ScrollView, ClipMask, редактор сцен, мультиплеер, 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")

Всё: окно, сцена, игровой цикл, управление.


Что внутри

  • Sprite — базовый класс с движением, эффектами, иерархией parent-child
  • UI: Button, ToggleButton, Slider, TextInput, TextSprite, Layout (flex/grid/circle/line)
  • ClipMask — маска обрезки для viewport, инвентарей, чатов
  • ScrollView — скроллируемый контент с колёсиком и drag-and-drop
  • Физика: pymunk, DYNAMIC/STATIC/KINEMATIC тела, коллизии
  • Анимации: Tween, Fluent API (DoMove, DoScale, SetEase...)
  • Частицы: ParticleEmitter, шаблоны, пулы
  • Мультиплеер: TCP, лобби, ChatScene, синхронизация
  • Audio: звук и музыка
  • Save/Load: PlayerPrefs в JSON
  • Sprite Editor: визуальная сборка сцен → JSON

Sprite Editor

Визуальный редактор сцен с иерархией, инспектором, gizmo.

Sprite Editor
python -m spritePro.cli --editor

Собираете сцену → сохраняете в JSON → загружаете в игре:

rt = spawn_scene("level.json", scene=self)
player = rt.exact("player").Sprite(speed=5)

Мультиплеерный чат

Готовая сцена чата с маской обрезки и скроллом:

from spritePro.readyScenes import ChatScene, ChatStyle
import spritePro as s

s.run(scene=ChatScene, multiplayer=True, use_lobby=True, title="Chat")

Сравнение

Функция pygame arcade SpritePro
Авто-рендер
Готовая камера
Физика (pymunk)
Layout (flex/grid)
Редактор сцен (JSON)
Маска обрезки / ScrollView
Мультиплеер (TCP)
PlayerPrefs

Что создать

  • Платформеры, аркады, RPG
  • Пазлы, tower defense
  • Мультиплеерные игры
  • Мобильные игры (platform="kivy")

Демо-игры

python -m spritePro.demoGames.physics_demo       # физика
python -m spritePro.demoGames.fluent_tween_demo   # твины
python -m spritePro.demoGames.layout_demo         # лейауты
python -m spritePro.demoGames.local_multiplayer_demo --quick

Все 54 демо


Mobile и Web

s.run(scene=MainScene, platform="kivy")  # Android/iOS
python -m spritePro.cli --android . --android-orientation portrait

Web: docs/builds/building_web.md


Документация

Что Где
Полный индекс DOCUMENTATION_INDEX.md
API Reference docs/API_REFERENCE.md
Для новичков docs/GETTING_STARTED.md
Физика docs/core/physics_guide.md
UI/Layout docs/ui/layout_ui.md
ClipMask docs/ui/clip_mask.md
Мультиплеер docs/systems/networking_guide.md
Sprite Editor docs/editor/sprite_editor.md
Mobile docs/builds/mobile_kivy.md

Вклад


📖 Документация · 💬 GitHub Issues

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

spritepro-3.8.0.tar.gz (323.9 kB view details)

Uploaded Source

Built Distribution

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

spritepro-3.8.0-py3-none-any.whl (398.2 kB view details)

Uploaded Python 3

File details

Details for the file spritepro-3.8.0.tar.gz.

File metadata

  • Download URL: spritepro-3.8.0.tar.gz
  • Upload date:
  • Size: 323.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for spritepro-3.8.0.tar.gz
Algorithm Hash digest
SHA256 3bdf3fecaa3645d22eec49961836272e82eca9736b7385e32cf713093be020bc
MD5 f97bb0b60243fa3dac29c74e18101794
BLAKE2b-256 11d9f0845e1432f9af1d5041d37ffe31356f90792780984614ea82b030e574ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for spritepro-3.8.0.tar.gz:

Publisher: publish-to-pypi.yml on NeoXider/SpritePro

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

File details

Details for the file spritepro-3.8.0-py3-none-any.whl.

File metadata

  • Download URL: spritepro-3.8.0-py3-none-any.whl
  • Upload date:
  • Size: 398.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for spritepro-3.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6d2ed544fbe2dcfcce0bf1dad343ffdf54cf17740eb31b814d42713b39190425
MD5 b6dd5e8da5e39c60fc0de5757fea2f8f
BLAKE2b-256 68b0b4a86ffdc2ebef3def864f2339e5f9db17c00449b8e2848bd61f536d5895

See more details on using hashes here.

Provenance

The following attestation bundles were made for spritepro-3.8.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on NeoXider/SpritePro

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