valleyblocks
a serene tetris with serverless p2p rooms โ this page is also the git repo.
Clone
This site serves the repository over git's dumb-HTTP protocol as plain static files (it's pinned to IPFS โ there is no git server here, or any server at all):
git clone https://git-game2.ardegazu.ro/valley-blocks.git
cd valley-blocks/client
npm install && npm run dev # port 4173
What it is
A Monument Valley-inspired Tetris PWA: SRS rotation with wall kicks, 7-bag randomizer, ghost piece, hold, guideline scoring, five palettes that shift every two levels, synthesized sound, and a rare steerable ๐ snake piece. Solo play works fully offline; sharing the page URL turns it into a private room for up to 16 players โ same pieces for everyone from a shared seed, race or outlast your friends, round after round.
How it works
- No game server. Browsers meet through a blind WebSocket
relay and form a full WebRTC mesh. The room secret lives in the URL fragment
(
#โฆ); the relay only ever sees a one-way HKDF room id. - Everything is end-to-end encrypted. Signaling payloads and
every game frame ride the sueta
p2p core (
client/src/lib/, copied unchanged): per-sender AES-256-GCM keys, structurally nonce-safe sealing, perfect negotiation, ICE-restart recovery, TURN fallback that still can't read anything. - One peer referees. The first browser in an empty room claims host; it deals seats and seeds, judges round outcomes, and hands a snapshot to late joiners (they spectate, then play the next round). If the host vanishes mid-round, the lowest open-channel id takes over and the round is voided. Boards themselves are simulated locally โ every player broadcasts their own compact board state, so your controls never wait on the network.
- The site is static files on IPFS. The game and this repo page are pinned to IPFS and served as an ird tunnel's offline page โ deploying is repinning a folder.
Honest guarantees & limits
Guaranteed: no accounts, no analytics, no database, no third-party requests. Room contents are end-to-end encrypted; the relay sees connection metadata only (scrambled room id, peer count, IP addresses โ as any relay must). Scores and history stay in your browser.
Not guaranteed: the host referees, and each player reports their own board โ a modified client could lie about its board. Play with friends, not strangers with prize money. Rooms are capped at 16 and a full mesh gets heavy past ~12 players on phones. Anyone with the room link is in the room โ treat links like invitations.
Layout
client/src/lib/ vendored p2p core (mesh, crypto, signaling, TURN) โ unchanged
client/src/game/ the game: core/ render/ input/ ui/ audio/ storage/ + party.ts
client/src/main.ts RoomCrypto โ Signaling โ Mesh โ App
site/ this page ยท deploy/publish-repo.sh builds the git mirror