Metadata-Version: 2.4
Name: jadepy
Version: 1.0.1
Summary: A tiny, fast 2D game framework for Python — Android-first, desktop-ready (Windows/macOS/Linux).
Author: JadePy
License: MIT
Project-URL: Documentation, https://example.invalid/jadepy
Project-URL: Source, https://github.com/yourname/jadepy
Keywords: game,2d,sprite,kivy,android,desktop
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Android
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: kivy>=2.2.0

# JadePy

A tiny, fast 2D game framework for Python — Android-first, **Windows/macOS/Linux-ready**, built on Kivy's Cython/OpenGL core.

Write whole games in ~20 lines. One codebase runs on **PyDroid 3**, **PyCode**, **Termux**, **Windows**, **macOS** and **Linux** — and ships as a standalone `.exe` or `.apk`.

```
./
├── jadepy/               # the module (one file — copy or pip-install it)
│   └── __init__.py
├── pyproject.toml        # `pip install jadepy` packaging (Windows-ready)
├── requirements.txt      # runtime dependency: kivy
├── examples.py           # 6 copy-paste demos (Pong, Flappy, Space Shooter, Platformer...)
├── site/index.html       # the website (open it in any browser)
├── course.html           # the 10-module JadePy course (39 exercises)
├── docs.md               # full documentation (source for the PDF)
├── JadePy_Documentation.pdf
├── buildozer.spec        # for packing an Android APK
├── main.py               # minimal runnable entry point
└── tests/test_engine.py  # engine unit tests
```

## Quick start

```bash
pip install kivy jadepy       # or: pip install -e .   from this folder
```

```python
from jadepy import Game, Sprite

game = Game(title="Hello JadePy", size="portrait")

@game.start
def begin():
    game.scene.add(Sprite(x=240, y=400, shape="circle", color="#4af",
                          w=60, h=60, vx=60, vy=40))

@game.frame
def step(dt):
    pass

if __name__ == "__main__":
    game.run()
```

Run it:

```bash
python game.py
```

## Windows / Desktop (Windows · macOS · Linux)

The same `game.py` above opens as a native window on all desktop OSes — no extra code.

```bash
pip install "kivy[base]" jadepy
python game.py
```

- Mouse click = tap, drag = drag, release = release (identical to touch).
- Keyboard via `@game.keydown` and `game.key("...")` (WASD / arrows / Space).
- The letterboxed viewport adapts to any window size.

**Build a double-clickable `.exe`** (share it without installing Python):

```bash
pip install pyinstaller
pyinstaller --onefile --windowed --name MyGame \
    --paths . --collect-submodules kivy \
    --add-data "assets;assets" \
    --add-data "jadepy;jadepy" \
    main.py
# → dist/MyGame.exe  (use ':' in place of ';' on macOS/Linux)
```

## Android (PyDroid 3 / PyCode / Termux)

1. Install Python (PyDroid 3 from Play Store, or Termux).
2. `pip install kivy`
3. Put `jadepy/` next to your `game.py`.
4. Run it. Done.

Wrap it into an APK with [buildozer](https://buildozer.readthedocs.io) — a ready `buildozer.spec` is included:

```bash
pip install buildozer
buildozer android debug
```

`requirements = python3,kivy,jadepy` in the spec keeps your APK small.

## Why not ...?

- **Pygame** — no Android support.
- **Arcade** — desktop only.
- **Raw Kivy** — powerful but verbose; you write widgets, layouts, kv files.
- **JadePy** — Kivy's speed (Cython + OpenGL) with a game-focused API: one `Sprite` class, physics, collision pairs, declarative callbacks, letterboxed viewport, packaged to `.apk` **and** `.exe`.

## Docs

- Website: `site/index.html` · Course: `site/course.html`
- Markdown: `docs.md` · PDF: `JadePy_Documentation.pdf`

## Tests

```bash
python -m pytest tests/
```

## License

MIT — do whatever you want.
