A minimal Tetris clone written in C11 with raylib. The entire game lives in a single main.c file.
- GCC
- raylib
On Arch Linux:
sudo pacman -S raylibgit clone https://github.com/nhlmg93/tetris.git
cd tetris
makemake downloads only json.h from stb into vendor/ (requires curl).
Run the game from the project root so shape assets can be loaded:
make runFormat the source:
make fmtAll tetromino shapes live in assets/shapes.json and are loaded once at startup. JSON is parsed with stb json.h (fetched by make; define JSON_IMPLEMENTATION in one source file).
| Key | Action |
|---|---|
| Left / A | Move left |
| Right / D | Move right |
| Up / W | Rotate |
| Down / S | Soft drop |
| Space | Hard drop |
| R | Restart |
MIT