teng ๐
A minimal, cross-platform game engine for the terminal in Rust
Features
- Fast rendering by only printing changed pixels to the terminal
- Built-in FPS limiter
- Batteries included: Components for common tasks (e.g. input handling, FPS display, mouse interpolation, half block rendering)
Showcase
See below for a clip of an unreleased game built in teng:
https://github.com/user-attachments/assets/c124958a-6093-41e9-90fe-56a2eb5d4618
Getting Started
teng uses components as the building blocks. Every frame, each component (optionally):
- Handles received events (mouse, keyboard, resizes, etc.)
- Updates the game state
- Renders its core concept (if any) to the screen
Here's a simple example that renders static content to the screen:
use io;
use ;
;
This results in the following:
FAQ
Why should I use teng over other TUI libraries?
teng particularly shines when you are not aware of libraries like ratatui or yeehaw.
Also, if you're looking to just get started with game development in the terminal, teng may be a good choice due to its simplicity and focus on traditional, frame-based game loops and pixel-based rendering.
Is teng an ECS?
Not really. teng's "Components" are quite similar to "Systems" in an ECS, but there is no built-in notion of entities or components in the ECS sense.
However, you can build an ECS inside teng quite easily, see examples/ecs for an example.
Missing features
- Currently, each pixel must be a single unicode scalar value, and its width is assumed to be 1. This means that wide graphemes, and graphemes consisting of multiple unicode scalar values, will most likely not be rendered correctly.
- teng makes a few assumptions about the capabilities of the terminal, without providing any fallbacks. For example, colors are RGB.
