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

SpritePro

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, multiplayer_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
Оглавление папки docs/ docs/README.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.9.3.tar.gz (327.0 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.9.3-py3-none-any.whl (402.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for spritepro-3.9.3.tar.gz
Algorithm Hash digest
SHA256 033da256e9f5c1c4b9b6d7ae4ce0774562cf6115ee59232f3f3c8c27fbda94e9
MD5 69ec9de7283e05bf718db2d7325a41c7
BLAKE2b-256 93ff1e5d02fe0f9451958cb82ef06af3e24e02e1495a6d48fabb07c8f8cb5b4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for spritepro-3.9.3.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.9.3-py3-none-any.whl.

File metadata

  • Download URL: spritepro-3.9.3-py3-none-any.whl
  • Upload date:
  • Size: 402.6 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.9.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8f04ee71df3a00eaa7755bd396acd767049918da10886d89f0670d55b6fc6c3a
MD5 d4b21516a01075a6d0b78aee616066e3
BLAKE2b-256 026bf703c41f31ddfa4d0edc0bfaf7ce860d64c06dc1b8f0fb0b00499be7e351

See more details on using hashes here.

Provenance

The following attestation bundles were made for spritepro-3.9.3-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