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.9.2.tar.gz (326.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.9.2-py3-none-any.whl (402.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spritepro-3.9.2.tar.gz
  • Upload date:
  • Size: 326.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.9.2.tar.gz
Algorithm Hash digest
SHA256 40a215b8b66d0f53c09c35febf7817a614819a658adfa1d23710d8a66eb8b0b0
MD5 decdfe5454464ed10bfaf4bed3d383ca
BLAKE2b-256 19f12789582d2476393b1bff4a4416a857df8c6cf2e8094100f97249fb8ece00

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: spritepro-3.9.2-py3-none-any.whl
  • Upload date:
  • Size: 402.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 439d8c1d487088b44ca8b54181bd45b0e48002afa59a38f4b45e0a2cedaff3d8
MD5 0f7f2d813153a8c9995bcee2366dec78
BLAKE2b-256 422a49b1f14aa4163a1ccdf7b2c715f5ada1ee87a331d6cfbbee3270921b6096

See more details on using hashes here.

Provenance

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