Key | Action |
---|---|
A / H / ← | Move current piece to the left |
S / J / ↓ | Move current piece down |
D / L / → | Move current piece to the right |
Z / ␣ | Rotate current piece clockwise |
To build, you will need the following C/C++ libraries and headers available:
- GLFW (Graphics Library Framework)
- GLEW (The OpenGL Extension Wrangler)
# apt install libglfw3 libglfw3-dev libglew2.1 libglew-dev
# dnf install glfw glfw-devel libGLEW glew-devel
# pacman -S glfw glew
Then, to compile it using GCC, just run
make tetris
or simply
make
(Assumes the pkg-config
command is globally available)
Additionally
make DEBUG=1
compiles with the -g
flag (for debug information) and no -O
,
make TRACK_FPS=1
will flood your stdout with some measure of frames per second when the game is ran,
make FAST_RENDER=1
will render the game by mapping each tile of the field to a texel instead of doing more complex vertex / triangle stuff, which I think is pretty neat, but doesn't seem faster at all... I mean, it's still about 10000 FPS on my machine but...
Of course, you can mix those flags whatever way you like.