candrewlee14/tetris-raylib
Tetris clone built with Raylib
I made for this for Coding Challenges's Tetris challenge.
I wanted to try hot reloading in C through recompiling & reloading the core game logic as a shared library. Being a big Zig fan, I decided to use Zig's build system to enable doing this in debug mode, but compile it all statically in release modes. If you hit the 'R' key in-game in a debug build, the game will reload but the state will be retained.
My final goal was getting this to run on the Steam Deck, which in the end worked wonderfully (see tweet)!
0.12.0-dev.2139+e025ad7b4
. This includes a C compiler with zig cc
!Now you're ready to go!
To run a debug build, run:
zig build run
To run a release build, run:
zig build -Doptimize=ReleaseSafe run
You can run in fullscreen mode with the --fullscreen
flag.
zig build run -- --fullscreen
This image was made for the purposes of a colorful screenshot, ignore all the gaps :)