Skip to content

Repository files navigation

blocks

play today's puzzle in your browser

A cute daily puzzle. Every day, everyone in the world gets the same set of pastel pieces; fit them all on the 4x4 board as fast as you can. The timer is your score: lower is better.

Built with Collider, so it runs as a native window and in the browser, and AI agents can play it over MCP out of the box. In fact:

an AI agent solving the daily

this demo was played, solved, shared and recorded by an AI agent
driving the game over MCP (4.77s, beat it if you can)

the menu, with today's time and a share button placing pieces the solved screen, with the share button

On a computer the pastel world stretches to fill the whole window, and every inch of it is playable surface:

the menu on a wide screen

How to play

  • Press play: the daily pieces are revealed and the timer starts.
  • Drag a block onto the board; it snaps wherever it fits. Drop it anywhere else and it just lies there, the whole window is the table.
  • Clicking works too: click to pick up, click again to drop.
  • Placed blocks can be picked up again.
  • R restarts today's puzzle (the clock restarts right away).
  • Beat the daily and the game remembers it: the menu shows the time of your first solve (replays are for fun, they never overwrite it) and the button becomes replay until the next challenge, with a countdown on the solved screen.
  • Press share to hand your result to a friend (see below).

On a phone the world is a portrait column. The game renders at 2x and scales down, so it stays sharp at any display scaling.

The pieces are dealt by carving the 4x4 board into random connected shapes, so every daily is solvable by construction. The deal is seeded by the UTC calendar date: same day, same puzzle, for everyone, with one global rollover at UTC midnight. The solved screen counts down to the next daily.

Share your time

Winning is only half of it: the solved screen and the menu both carry a share button that turns your result into a little card.

blocks #219 · 12.07s
🟨🟨🟥🟦
🟨🟩🟥🟦
🟧🟩🟪🟦
🟧🟧🟪🟪
https://lucasantunesdealmeida.github.io/Blocks/

The squares are the board you solved, in the colors of the pieces you placed, and the link drops whoever reads it straight into the same day's puzzle: that is how a daily finds its next player.

On phones and on browsers that support it, the button opens the system share sheet, so the card goes to WhatsApp, Instagram, messages or mail in one tap. Everywhere else (and always, as a backup) it lands on the clipboard, ready to paste.

The card always carries the time of your first solve of the day, never a replay clock, and the board rides along in the save: come back in the evening and today's result is still yours to share. Sharing is one small build-tagged file per platform (share_js.go, share_windows.go, share_unix.go), the same shape as the save.

Built with Collider

The whole game is one small Go program on top of Collider's object-and-collision model:

  • Scenes are the screens: the menu and the game are two g.Scene calls, switched with g.Go. The menu's bobbing mascots are three sprites moved in OnUpdate.
  • Every piece is a group of sprite Objects, one per cell, moved together. Grabbing uses scene.OnClick hit-testing; the smooth follow, snap preview and drag-release run in scene.OnUpdate.
  • The art pipeline is Collider's philosophy applied to assets: like the engine's genassets, every sprite is generated by code (tools/genassets), and engine.UseAssets + go:embed pack them into a single binary. The buttons are drawn by the same routine as the pieces, just stretched: everything you press is a candy tile.
  • Buttons are sprites plus text: a plate object carries the OnClick, a label object rides on top, and the label never eats the press because only the plate has a handler.
  • The win confetti is the physics system: scene.Gravity plus WithGravity rectangles with a LifeTime, spawned in After timer waves.
  • AI agents can play it out of the box: Controls, AgentDocs and AgentState make the game self-describing over MCP (COLLIDER_AGENT=mcp), and the test suite uses the same machinery: a headless bot (g.Headless + g.Step) solves a full daily through the real click pipeline on every go test.
  • Shipping is the engine's publishing path: one .exe, or the WebAssembly build this repo deploys to GitHub Pages.

Run locally

go run .

Play in the browser

Every push to the default branch builds the WebAssembly version and publishes web/ to GitHub Pages (.github/workflows/deploy.yml). One-time setup: repository Settings → Pages → Source → GitHub Actions.

To try the web build locally:

GOOS=js GOARCH=wasm go build -o web/game.wasm .
cp "$(go env GOROOT)/lib/wasm/wasm_exec.js" web/
npx serve web   # or any static file server

Regenerate the art

All sprites are drawn by code: pastel rounded tiles with little faces, the buttons, the board, the backdrop, and the README banner:

go run ./tools/genassets

The font is Fredoka (SIL Open Font License, see fonts/OFL.txt).

About

A cute daily block puzzle in Go, built with Collider. A new challenge for everyone every day. Play in the browser or natively.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages