A customizable, cross platform, open-source falling block game, packed with a bunch of features.
Clone or download
mmatyas Fixed SDL Mixer initialization
Workaround for the Mix_Init issues of SDL Mixer 2.0.2.
Latest commit 8eac72a Sep 17, 2018



Linux/OSX build status Windows build status Coverity Scan Build Status

A customizable, cross platform, open-source falling block game, packed with a bunch of features.



  • Ghost piece support
  • Hold piece support
  • Customizable next pieces support
  • Customizable DAS support
  • SRS, TGM and Classic rotation
  • Full wall- and floor kick support
  • 7-piece bag random generator
  • Classic, Extended and Infinity lock support
  • Sonic drop and Zangi-move support
  • T-Spin and Mini T-Spin support
  • Combo support
  • Battle mode, Sprint and Ultra
  • Proper menu, configuration and stats
  • Gamepad support
  • Music and sound effects
  • Big screen, small screen support
  • Runs on most desktop systems
  • Runs on embedded Linux, even without X11
  • Runs in browsers (experimental)
  • Theme support


See the Releases page to download the latest version.

On Debian/*buntu, you can also install the game from a PPA:

sudo add-apt-repository https://dl.bintray.com/mmatyas/deb
sudo apt-get update
sudo apt-get install openblok


  • CMake (at least 3.1)
  • C++11 supporting compiler (GCC 4.9 or better recommended)
  • SDL2, SDL2_image, SDL2_mixer, SDL2_ttf
  • optional: gcov, lcov (for generating test coverage report)

Eg. on Debian: sudo apt install cmake libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev

or on Fedora/RPM: sudo dnf install cmake SDL2-devel SDL2_image-devel SDL2_mixer-devel SDL2_ttf-devel


mkdir build && cd build
cmake ..
./src/openblok --data ../data

Optional build parameters:

  • ENABLE_MP3, ENABLE_MOD, ENABLE_FLAC, ENABLE_JPG: Enable/disable loading certain media formats. Default: MP3 and JPG ON, MOD and FLAC OFF
  • CMAKE_BUILD_TYPE: To create an optimized release build, set this to Release. To create a debug build, set this value to Debug. See the CMake documentation. Default: Release.
  • INSTALL_PORTABLE: The game needs to know where it can find the data files. By default, the game is searching for them in the absolute path of the installation location, which is usually /usr/local/share/openblok or C:\Program Files\openblok. By setting INSTALL_PORTABLE to ON, the game will search for the files in the same directory as the binary. Default: OFF on Linux, ON on Windows.
  • CMAKE_INSTALL_PREFIX: The base directory of the installation step (eg. make install). Defaults to /usr/local or C:\Program Files. See the CMake documentation.
  • BUILD_TESTS: Builds the test suite. You can run them by calling ./build/tests/openblok_test. Debug build only, default: ON.
  • BUILD_COVERAGE: Allows building the test coverage report. Requires BUILD_TESTS and gcov/lcov. Default: OFF.
  • USE_BOOST_REGEX: If your compiler does not support std::regex (eg. GCC 4.8), you can use Boost.Regex instead. Default: OFF.

Useful build targets

  • make coverage: Builds the test coverage report
  • make install/strip: Installs the game on your system
  • make package: Creates tar.gz and Debian deb packages


Runtime arguments

You can change certain game parameters, eg. the location of the data directory. Run the game with the --help flag to see the available options.

Hardware acceleration on ARM Linux

Using the default SDL2 library shipped with Debian/Raspian, hardware acceleration may not work properly, causing slowness and ugly graphics. For the best performance, it is recommended to build your own SDL2, as described here. With hardware acceleration, OpenBlok runs full speed even on a first-gen Raspberry Pi.