pytermgame
You've seen frameworks for making terminal apps (textual, pytermgraphics, asciimatics etc.), but how about a framework for games ... like pygame but in the terminal?
Supports Python 3.10 or above
Installation
Install from pip
pip install pytermgame
Or, install with the latest updates (may be unstable)
git clone https://github.com/tovicheung/pytermgame
cd pytermgame
pip install .
Features
- pygame-inspired api structure
- customizable terminal behaviour (alternate screen, cursor visibility)
- scene-switching within a game, each with its own sprites
- supports scrolling
- extensible sprite class
- collision engine with sub-tick motion prediction
- optimized rendering: game calculates the minimum number of objects to erase and re-render (it takes care of overlapping sprites too!)
- cross-platform key event reading
- includes an integrated debugger and an external profiler
- (New) basic composite UI support:
ptg.ui
Tested on
- Windows 10 & 11
- WSL Ubuntu 22.04
Unfortunately i am too broke to afford a mac
Examples
Examples are included in examples/.
Playing instructions are included in the respective files.
Demo
https://github.com/user-attachments/assets/202c4f01-b9ec-4aac-bbbc-0cfa07369a2d
https://github.com/tovicheung/pytermgame/assets/demo_breakout.mp4
Atari breakout gameplay (example 4)
Future plans
check out TODO.md
Metadata
Release files for pytermgame 1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytermgame-1.2.tar.gz | 66.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytermgame-1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 126.9 kB
Release files / pytermgame-1.2.tar.gz
| Download URL | pytermgame-1.2.tar.gz |
|---|---|
| Size | 66.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ebdfcbf1befc8dc4fa54ebe4cf3c2898a0e46f4706b1f15ee9a39989e883d271
|
|
BLAKE2b-256 checksum How to use checksums |
5aa39b7b896b61163400c46e2610c8b44b0edc665eb129840c087c6dbfe3d8b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / pytermgame-1.2-py3-none-any.whl
| Download URL | pytermgame-1.2-py3-none-any.whl |
|---|---|
| Size | 60.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d22ca42c59fe15eb19f5812b22c9ee8c9b2bae3cab95cd97fb0015841c816821
|
|
BLAKE2b-256 checksum How to use checksums |
d99db41d9fed6ab5dfca8349efded6a2992dd70d327b5bd6ee3e201cea38cc16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|