Skip to main content

tegen

Documentation Status PyPI version Github Version Python Versions License

GitHub code size in bytes GitHub repo size GitHub last commit GitHub Release Date CodeFactor PyPI - Downloads

Terminal game engine for Python, made by 7d

Latest release version: v0.0 (29/8/21) Changelogs: https://tegen.readthedocs.io/en/latest/changelog.html

Documentation: https://tegen.readthedocs.io/en/latest/

images/tictactoe.gif

Why 'Tegen'?

Terminal Game Engine

Usage

import tegen
from blessed.keyboard import Keystroke

game = tegen.Game()
scene = tegen.Scene()

class GameObj(tegen.objects.Sprite):
    direction = 1

    def on_keyboard_press(self, g: tegen.Game, key: Keystroke):
        if key == "a":
            self.x += 1

class GameText(tegen.objects.Text):
    def on_keyboard_press(self, g: tegen.Game, key: Keystroke):
        self.text += key
        if key == 'q':
            g.end()

scene.add_object(GameObj(), "obj", 0, 0)
scene.add_object(GameText("", back="ffa500"), "key", 0, 4)

try:
    game.start(info_wait=1)
    game.add_keyboard_listener()
    game.load_scene(scene)
except Exception:
    game.handle_error()

Example tictactoe game

Release files for tegen 0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tegen 0.0
File Size Uploaded
tegen-0.0.tar.gz 23.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tegen 0.0
File Interpreter ABI Platform
tegen-0.0-py3-none-any.whl Python 3 none any Details

Total release size: 47.2 kB

Release files / tegen-0.0.tar.gz

Download URL tegen-0.0.tar.gz
Size 23.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5017573e16145f45975466523a7b43c72174c8a4fdda72925da7bf961646eee3
BLAKE2b-256 checksum
How to use checksums
31078045bc920f53949062891200362add83dc9b273635202149dca8c0de37b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6

Release files / tegen-0.0-py3-none-any.whl

Download URL tegen-0.0-py3-none-any.whl
Size 24.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4c9b2b8aadb6a8f960dcfbdb22227a444868682ef9adbc947b2edc49521a5577
BLAKE2b-256 checksum
How to use checksums
a36b17fed2379d53722c8b21791683b5e7b961163bea3de84dd7d4424b41fbf3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page