#cli #blocks

app rustblocks

Rustblocks is a simple tetromino based falling blocks game

6 releases

new 0.3.2 Feb 16, 2024
0.3.0 Feb 9, 2024
0.2.2 Feb 8, 2024
0.1.0 Feb 7, 2024

#21 in Games

Download history 130/week @ 2024-02-06 224/week @ 2024-02-13

354 downloads per month

MIT license

6.5MB
443 lines

Contains (DOS exe, 6.5MB) bin/Windows/rustblocks.exe, (Mach-o exe, 1.5MB) bin/MacOS/rustblocks

Rustblocks

Rustblocks is a simple tetromino based falling blocks game that uses crossterm to draw blocks in the terminal. A reasonable Unicode capable font is required as the character \u{2588} is used to draw the blocks.

The game sticks roughly to 'official' piece dynamics but does not implement 'kicking' off the walls. It is entirely single threaded, with no async.

For performance, the game maintains two board buffers, last and current. Pieces are always recorded on the current board, and when committed only the differences are drawn to the screen.

Controls:

- Arrow keys or h,j,k,l to move
- space to drop
- Delete or Backspace to restart
- d toggle difficulty
- q to quit
- u to undo
- n to toggle next piece display
- t key toggles the tracer block

Running rustblocks

rustblocks -h

Usage: rustblocks [OPTIONS]

Options:
  -x, --horizontal <HORIZONTAL>  The width of the board [default: 10]
  -y, --vertical <VERTICAL>      The height of the board [default: 22]
  -n, --hide-next-piece          Whether to show the next piece
  -d, --difficulty <DIFFICULTY>  The difficulty of the game, changes the speed of the game. Easy, Medium, Hard, Insane, or 1, 2, 3, 4 [default: Easy]
  -h, --help                     Print help
  -V, --version                  Print version

Installing

cargo install rustblocks

Binaries

MacOS

Rustblocks x86_64 (will run on M1/2/3)

Windows

Rustblocks x86_64 (will run on Windows for Arm)

Dependencies

~4–14MB
~152K SLoC