Terminal game engine for Python
Project description
tegen
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/
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()
Project details
Release history Release notifications | RSS feed
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 hashes)
Built Distribution
tegen-0.0-py3-none-any.whl
(24.0 kB
view hashes)