ambigui2

That time I made a code blocks game that has two states and I can only see the actual block when it lands.


LIVE

Controls

← → move rotate soft drop Space hard drop C hold R menu

A Zig-based blocks stacker game with an AI agent, built as an Intro to Modern AI coursework project. The core twist: each falling piece exists in a probabilistic superposition of two shapes — it only collapses into a definite block when it lands.

Stack

Engine
Custom
Renderer
Raylib (native + WebAssembly)
Web target
Emscripten / emsdk
Languages
Zig

ENGINE

  • Dual-state pieces — each move carries two simultaneous shapes with a probability weight; the active shape resolves on lock
  • LUT rotations with SRS clockwise wall kicks for accurate Super Rotation System behaviour
  • Bitboard-based board representation for fast collision detection and line-clear processing
  • 7-bag piece randomizer with next-piece preview and hold queue
  • Non-linear scoring with level progression and gravity scaling

update

The vs AI gameplay is not yet implemented due to it having an AI worker thread. WASM is single-threaded and my server do not have COOP/COEP response header and SharedArrayBuffer yet.

Source

github.com/Xuinnz/ambigui2