Another very disruptive game, written in C++.
commands in parenthesis are vi-like alternatives
- z (k)- rotate
- space- drop
- LeftArrow (h)- left
- RightArrow (l)- right
- Down Arrow (j)- down
The following procedure has been tested on Ubuntu 20.04.
Just run the INSTALL.sh script, from the source directory:
chmod +x INSTALL.sh; ./INSTALL.shThis script will build the project, assuming you have the correct dependencies.
WARNING Please read the first few lines of the script if the procedure fails. They provide information about dependencies installation.
To run the game, run
./bin/tetrisfrom the source directory.
If you want to compile the project step by step, the categories below provide more details.
To compile this project, some packages have to be installed on your machine.
First, install some usual packages concerning C/C++ build.
sudo apt install gcc libstdc++6 make cmake Those packages are respectivelly the C/C++ compiler, the C++ standard library, and make/cmake build tools.
The project is also based on the SFML project (Simple Fast Multimedia Library).
To install the required module of this library, run
sudo apt install libsfml-dev libsfml-graphics2.5 libsfml-system2.5 libsfml-window2.5To compile the game, you first need to create a build directory aside from the source:
mkdir binThen, run cmake with Release build option:
# from source dir
cmake -S . -B bin -D CMAKE_BUILD_TYPE=ReleaseOther available build options are Debug and RelWithDebInfo
Then, run make
make -C binA binary file called tetris has been created in the build folder.
./bin/tetrisIf it fails with a message such as permission denied: ./tetris, you need to grant tetris the execution permission by running :
chmod +x ./bin/tetris- The .ttffile is a font that is recquired to display the score on screen.