To start on a higher level, run the game with the level as a command line argument. e.g. ./TetriC 10
or ./TetriC.exe 10
for Windows users.
Controls:
← ↓ ↑ → : movement
z x : rotate
m : mute/unmute music
A Tetris clone written in C.
I intend on making this clone as close to the original port on the NES, with some changes here and there.
Graphics are rendered using SDL 2.0, so if you want to compile this from source you will need to download the SDL2 library files for your OS.
Since I am using SDL2.0, you will need is the SDL2 libraries, as well as the gcc compiler and make.
On Arch Linux: sudo pacman -Syu gcc sdl2 make
On Ubuntu: sudo apt-get install gcc make libsdl2-dev libsdl2-2.0
After installing the necessary packages:
git clone
this repositorycd
into the directory you cloned it in- compile it with
make
.
Note: If you would like to just play the game, you can simply just run the provided TetriC.exe
.
- Clone or download this repository into a folder somewhere on your computer.
- Install MSYS2. When selecting the installation directory, choose the default.
- From the link above, follow the instructions that say to run
pacman -Syu
andpacman -S --needed base-devel mingw-w64-x86_64-toolchain
in the MSYS2 terminal. This will install thegcc
andmake
development tools. - After you install
gcc
, you will need to add it to PATH so that you can run it from the terminal.- Click the search bar by your start menu
- Type 'Edit system variables' and click on the result
- Click 'Environment Variables'
- Under 'System variables' (Not user variables!) select
Path
, and click theEdit...
- Click new, then add
C:\msys64\usr\bin
to the list and click OK. - To verify you performed this steps correctly, open
cmd
orpowershell
and type gcc. - You should receive an error saying
gcc.exe: fatal error: no input files
- After adding
gcc
to PATH, you will now need to install the SDL2 libraries.- open
MSYS2 MinGW x64
(just type it in the Windows search bar) - In this terminal, execute the following commands to install the SDL2 libraries
pacman -S mingw-w64-x86_64-SDL2
pacman -S mingw-w64-x86_64-SDL2_ttf
pacman -S mingw-w64-x86_64-SDL2_image
pacman -S mingw-w64-x86_64-SDL2_mixer
- open
- Once you have the steps above complete, you should now be able to compile the source code.
- Go to the
Windows
directory in this repo - In the File explorer path name, type
cmd
orpowershell
, this will open a command prompt in the directory you are currently in. - Type
./compile.bat
, if everything went well, you should now have a file namedTetriC.exe
in your Windows folder. You can now open it to play TetriC.
- Go to the