Skip to main content

Terminal game engine for Python

Project description

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

Project details


Release history Release notifications | RSS feed

This version

0.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tegen-0.0.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

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

tegen-0.0-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file tegen-0.0.tar.gz.

File metadata

  • Download URL: tegen-0.0.tar.gz
  • Upload date:
  • Size: 23.2 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for tegen-0.0.tar.gz
Algorithm Hash digest
SHA256 5017573e16145f45975466523a7b43c72174c8a4fdda72925da7bf961646eee3
MD5 8f7ae85175bfa12d75a585b4d757472a
BLAKE2b-256 31078045bc920f53949062891200362add83dc9b273635202149dca8c0de37b8

See more details on using hashes here.

File details

Details for the file tegen-0.0-py3-none-any.whl.

File metadata

  • Download URL: tegen-0.0-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for tegen-0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c9b2b8aadb6a8f960dcfbdb22227a444868682ef9adbc947b2edc49521a5577
MD5 f1021bf5789bb8de2724fe9363bdfd42
BLAKE2b-256 a36b17fed2379d53722c8b21791683b5e7b961163bea3de84dd7d4424b41fbf3

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