Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

blocks

A falling-block puzzle game in Odin, drawn with raylib. It is a parody of Block Blast.

The project is still scaffolding. The window opens and the loop runs, but game.update is empty and most rule procedures call unimplemented().

Requirements

  • Odin on your PATH
  • Zed with the Odin extension for autocomplete and highlighting

raylib ships in Odin's vendor collection. There is nothing else to install.

Build

./build.sh          # debug build
./build.sh release  # optimized build
./build/debug/blocks

In Zed, run task: spawn and pick odin: build & run.

The project also has tasks for debug and release builds, type checking, and running every @(test) procedure in src/game.

Layout

src/main.odin       window, frame loop, key bindings
src/game/           rules with no raylib dependency
  board.odin        playfield grid
  piece.odin        pieces, rotation, wall kicks
  bag.odin          shuffled piece generator
  game.odin         game state and update step
src/render/         raylib drawing
build.sh            build script
.zed/               tasks, debugger, editor settings

build/ is generated and ignored by Git.

The debugger launches build/debug/blocks, so run a debug build first. The binary name also appears in build.sh, .zed/tasks.json, and .zed/debug.json. Change all three together.

Odin prints errors as path/main.odin(12:5). build.sh rewrites them as path/file.odin:12:5 so Zed makes the locations clickable.

About

Scaffolding for a falling-block puzzle game written in Odin with raylib

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages