Tetris written in C

Tetris

Picture of tetris

Link to the repository

Building

Just git clone the repository to your machine.

If you use macOS or linux you should be just able to run make in the directory to build the executable.

You need SDL2, SDL2-mixer and SDL2-ttf installed on your computer to build the executable.

Ubuntu/Linux Mint:

sudo apt install libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev

Arch based distros:

sudo pacman -S sdl2 sdl2_mixer sdl2_ttf

Homebrew:

brew install sdl2 sdl2_mixer sdl2_ttf

Windows:

I have no idea. You're going to have to figure it out yourself. You just have to link sdl2, sdl2-mixer, and sdl2-ttf so I doubt it'll be too difficult.

Features

You can add your own theme by creating the folders resources and resources/audio and putting a .wav file into the audio folder

There is now a simple ui that lets you start, quit or resume the game

I went for a minimalistic look and tried to not use any pre-existing assets and rather use sdl2 api calls to draw everything

The controls are:

  1. A or left arrow and D or right arrow go left and right
  2. S or down arrow drops the tetrominos faster
  3. W or up arrow rotates the tetrominos
  4. Space bar instantly drops the tetrominos
  5. Both shifts stash the current tetromino and retrieves a new one from the stash if one exists
  6. Esc pauses and unpauses the game

Please keep in mind that the game is not finished yet