Tetrust is a tetris clone built as a text user interface (TUI) using rust.
key | control |
---|---|
A |
move tetromino left |
D |
move tetromino right |
S |
drop tetromino |
Left arrow | rotate tetromino left |
Right arrow | rotate tetromino right |
P |
pause |
ESC |
quit game early |
Why did I spend my time working on this?
- I wanted to write more rust code
- I wanted to write a TUI game
- Initially, I had aspirations this might be a good playground to experiment with data-oriented design and entity-component systems. That never panned out, but it was an original motivator.
- I found it gratifying to build something to a semi-polished "v1" state. Often, my toy projects get 40-80 hours of time from me before I hit some wall and lose motivation before getting to any kind of demo state.
As this is a personal project, there are a lot of gaps in functionality and polish. Notable ones include:
- no in-game control explanations
- no SFX
- no installer
Nevertheless, I still consider the game in a V1 state. Humor me :)
There is currently no installer. To install and play the game, you'll need to build and run from source which isn't too gnarly. As a prerequisite you'll need a reasonably up-to-date rust installation.
- clone this repo
cargo run --release
Despite
- Basic tetris rules
- Blocks fall and rotate
- Lines can be cleared
- Blocks fall faster as more lines are cleared
- Classic arcade-style leaderboard
- Separate start, game, and leaderboard screens
- game music
- SFX
- AI match
- Multiplayer match
- Network multiplayer
As I was working on the project I thought it'd be fun to record each milestone in a gif to demonstrate progress. Here they are in reverse chronological order w/ attached commits:
- V1 (Jan 18. 2021)
- Tetris has some surprisingly interesting and complex rules that have changed and been tuned across its many iterations. The one I found most interesting (which I still don't really have a good implemenation for) was that many tetris games iterated on how pieces were allowed to rotate. In some early forms it was super simple but as the game was re-implemented and improved it became more complex. The gold standard for tetris games now usually requires some logic for "wall kicking".
- As I was closing in on V1, it was wild to look back at the first commit in the repo. I started the project in mid 2019 and dropped it after making some sizable progress but running into a blocker with how I wanted to constrain the tetris board. It was very gratifying to come back to the project a year and a half later, unblock myself, and get to a V1. Tying up loose ends is a special sort of satisfying.
To be continued...? (probably not)