Skip to main content

Like pygame, but in the terminal

Project description

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

[!NOTE] This is not a full-fledged game engine, but more of an experiment to create terminal games

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

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

pytermgame-1.2.tar.gz (66.2 kB view details)

Uploaded Source

Built Distribution

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

pytermgame-1.2-py3-none-any.whl (60.7 kB view details)

Uploaded Python 3

File details

Details for the file pytermgame-1.2.tar.gz.

File metadata

  • Download URL: pytermgame-1.2.tar.gz
  • Upload date:
  • Size: 66.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for pytermgame-1.2.tar.gz
Algorithm Hash digest
SHA256 ebdfcbf1befc8dc4fa54ebe4cf3c2898a0e46f4706b1f15ee9a39989e883d271
MD5 d1ff1f6a9c49477d5964b33c7b3591e6
BLAKE2b-256 5aa39b7b896b61163400c46e2610c8b44b0edc665eb129840c087c6dbfe3d8b7

See more details on using hashes here.

File details

Details for the file pytermgame-1.2-py3-none-any.whl.

File metadata

  • Download URL: pytermgame-1.2-py3-none-any.whl
  • Upload date:
  • Size: 60.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for pytermgame-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d22ca42c59fe15eb19f5812b22c9ee8c9b2bae3cab95cd97fb0015841c816821
MD5 2fb17d489b1b8b98d97eb2d8580d7f97
BLAKE2b-256 d99db41d9fed6ab5dfca8349efded6a2992dd70d327b5bd6ee3e201cea38cc16

See more details on using hashes here.

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