o
odin.langpkg.dev
packages / library / blocks

blocks

0dd7619library

A Tetris clone.

No license · updated 9 months ago

Blocks!

This is a simple Tetris clone, made in Odin using the Raylib game framework. This is simply an exercise. I make no claims about the correctness of the code. Use it for examples, fork it if you want. This is unlikely to receive updates.

Building and Running

VS Code

If you have the Microsoft C/C++ extension and the Odin compiler in your system's PATH, cloning this repo, opening the folder in VSCode, selecting the appropriate debug mode (Windows or Linux), and starting the debugger should build and run the game.

Manual

Both build scripts support the follwing options:

  • debug - builds a debuggable version of the game
  • release- builds a release version of the game
  • clean - removes the out folder. Intended to be used while developing to generate clean builds.

Linux

./build.sh with one of the above options builds the game in ./out/Debug or ./out/Release, depending on the option chosen.

Windows

Identical to Linux, save for the script: powershell.exe -File ./build.ps1 is the command to run the build script.

Controls

  • A: Move block left
  • D: Move block right
  • S: Speedy Drop
  • J: Rotate block clockwise
  • K: Rotate block anticlockwise