Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ringtailsoftware/zigtris
A minimal terminal Tetris written in Zig
https://github.com/ringtailsoftware/zigtris
zig-package
Last synced: 20 days ago
JSON representation
A minimal terminal Tetris written in Zig
- Host: GitHub
- URL: https://github.com/ringtailsoftware/zigtris
- Owner: ringtailsoftware
- License: mit
- Created: 2024-11-17T19:50:13.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-12-14T14:07:13.000Z (28 days ago)
- Last Synced: 2024-12-14T15:18:34.655Z (28 days ago)
- Topics: zig-package
- Language: Zig
- Homepage:
- Size: 594 KB
- Stars: 16
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-zig - ringtailsoftware/zigtris
README
# Zigtris
A minimal terminal Tetris written in Zig. Tested with Zig 0.13.0
`zig build run`
Cursor keys to move, space to drop, `q` to quit.
![](demo.gif)
# I just want to play! don't make me install Zig
docker run --rm -it -v `pwd`:/app -w /app kassany/alpine-ziglang:0.13.0 zig build run
# Run as a service via ssh
./run-as-service.sh
ssh zigtris@localhost -p 2022
# Notes
Some notes for anyone looking at the code:
- `Display` is a thin wrapper on top of the `mibu` terminal library, it provides a double buffered one pixel per character interface where it only redraws changed pixels on the buffer flip
- `Stage` is the game stage and provides a square pixel interface on top of `Display` (by printing two chars for each pixel)
- `Player` holds the `Tetronimo` shapes and movement logic
- `Debris` holds the list of fallen blocks for hitchecking and completed line detection# License
MIT