tas: check for nil instead of "fail"
tiles: update empty/space tile
Don't stack-allocate unnecessary byte for path
This is a clone of NES Tetris. The base game remains as faithful to the original as possible, but the game also adds new features and includes a modding API.
For more information, see the website.
The only dependencies are a POSIX-compliant C11 environment, a POSIX-compliant
implementation of make
, a pkg-config implementation (such as pkgconf), and
development files for SDL2, SDL2_mixer, and Lua 5.4.
For non-Windows:
make
FreeBSD users (and possibly other platforms as well) will need to override the LUA macro:
make LUA=lua-5.4
Then run make install
to install, optionally setting PREFIX and DESTDIR. You
may also want to run make install-mods
to copy the mods from contrib to your
data directory. All mods are opt-in from the options screen, with the exception
of statistics which is enabled by default.
Compiling for Windows can be done with MinGW. I do it by cross-compiling to
MinGW from a non-Windows environment. Using Alpine Linux with mingw-w64-gcc
, I
do this:
make -f Makefile.mingw generic-tetromino-game.zip
This creates a zip file containing all assets the game needs to run. The .exe
can be run natively on Windows. You may need to set the PREFIX
and
MINGW_PREFIX
macros to different values in the above command to suite your
environment.
Also note that the Windows build doesn't support online play, since it's implemented using the POSIX sockets API. I honestly have very little interest in writing much platform-specific Windows stuff, since Microsoft are the ones not following standards here. In retrospect, I probably should've used SDL2_net, but eh whatever. If anyone wants this, you are free to implement this yourself and send a patch.