tui-engine
Version, currently master branch1 version
- master branchlatestMay 4, 2024
github.com/drujensen/tui-engine
Text Based Game Ending
Installation
# Add this to your shard.yml
dependencies:
tui-engine:
github: drujensen/tui-engine
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
1.3.2- License
- MIT
- Author
- Dru Jensen
Dependencies
This version declares no dependencies.
README
TUI Engine
TUI Engine is a text based gaming engine.
Installation
-
Add the dependency to your
shard.yml:dependencies: tui-engine: github: drujensen/tui-engine -
Run
shards install
Usage
require "tui-engine"
This library provides a gaming engine, a text based ui components for display, and an event system for actions.
A base Map provides a way to build a hierarchical layered UI.
There should be a root map that handles the background and covers the whole playing area. Then you add other layers of maps on top of it that represent Menus, Objects or Characters in the game. When rendering the root Map, it will call render on each of the children.
An Event system is provide to register for events. There are 4 events:
- TickEvent - Every tick in the game loop
- KeyEvent - When a key is pressed
- BumpEvent - When a map is moved outside of the parent maps boundary
- ActionEvent - When two sibling maps collide that are on the same z axis
A game engine is provided that handles the game loop. It reads any input, calls the update to render the maps and then outputs the rendered up. The loop is ran at 30fps.
Development
This library is written using the Crystal programming language. No other dependencies are needed.
Contributing
- Fork it (https://github.com/drujensen/tui-engine/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Dru Jensen - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- May 4, 2024
- Crystal
1.3.2- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/drujensen/tui-engine
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 16, 2026
- Synced
- Aug 16, 2026
- Versions
- 1