Two entangled qubits.
One circuit.
A two-player co-op Metroidvania where you are two entangled qubits restoring a decohering quantum circuit. Jump together, split up with quantum gates, and open a path that only moves for both of you. Play on one keyboard, or on two computers over the internet.
Two players, two qubits, one bond.
The whole game is built around the pair. Neither qubit can finish the circuit alone, so progress is a conversation: who flips gravity, who phases through the wall, who holds the bridge solid while the other crosses.
Move as a pair
Each player drives one qubit. An entanglement bond links you across the screen, and some doors only open when both of you are in the right place.
Use quantum gates
Flip a qubit (Pauli-X), split into superposition (Hadamard), add a phase (S), measure and correct errors. Each gate is a traversal ability with a real physics name.
Explore and restore
One connected world of rooms with hidden fragments to find. Anchors save your progress; a flickering bridge turns solid once you keep it in phase.
In the game, gates are bent for fun; where it bends real physics, it says so. It won't teach you quantum computing on its own, but you'll pick up how real gates behave, one puzzle at a time.
Grab a friend.
Share a keyboard for local co-op, or send a 5-letter invite code and play across the internet. The browsers connect directly peer-to-peer; if a NAT blocks the route, the server relays within about six seconds, with no change to the game.
| Action | Qubit |0⟩ | Qubit |1⟩ |
|---|---|---|
| Move | AD | ←→ |
| Jump | WSpace | ↑ |
| Use gate | F | / |
| Next gate | G | . |
Every key is remappable, gamepads work on the web, and the camera looks around with the mouse like Hollow Knight. The HUD shows P2P or RELAY, the round-trip time and the rollback depth.
Built to stay in sync, everywhere.
The same deterministic engine runs local play, the online netcode and the tests, so both computers always see the exact same world.
Local & online co-op
Play on one keyboard, or across two computers. "Invite a friend online" carries your local progress straight into a shared room.
Rollback netcode
Peer-to-peer WebRTC with rollback keeps both players responsive. Every online test asserts both simulations agree with zero desyncs.
Deterministic engine
A pure, fixed-point Engine.step(state, in0, in1) shared by local play, the netcode and the tests. Same inputs, same world, every time.
Quantum gates
Hadamard, Pauli-X, Phase, measurement and error correction are the traversal abilities. Plain words first, the real term second.
One connected world
A Metroidvania map of 25 rooms and 13 hidden fragments, with anchors to save at and a map you can open at any time.
Browser & desktop
One shared Kotlin client renders in the browser (Kotlin/Wasm, Canvas) and on the desktop (Compose Desktop, Skia), with the same art and menu.
One deterministic core, many front ends.
Twin Circuit is my end-to-end project: a Kotlin Multiplatform game that shares a single deterministic engine between local play, rollback netcode and tests, with a Rust backend that handles rooms, signalling, the relay and save sync.
Heavy work — save sealing, compression, distance fields and reachability — runs off the main thread in Web Workers, so the game stays smooth while it thinks.
Clients
Shared Kotlin Multiplatform code with two front ends: Kotlin/Wasm (Canvas) in the browser and Compose Desktop (Skia) on the desktop.
Engine
Pure, fixed-point, deterministic Engine.step: world, physics, abilities, state codec and reachability, shared JVM + Wasm.
Netcode
Wire format, rollback session and peer link over peer-to-peer WebRTC, with a loopback transport for tests.
Off-thread jobs
Offthread Web Workers for HMAC save sealing, LZ compression, distance fields and reachability.
Server
Rust (axum / tokio): guests, rooms and invite codes, WebRTC signalling, the relay, desync arbitration, save sync and static hosting.
Entangle with a friend.
Twin Circuit runs in your browser — no install. Create a room, share the 5-letter code, and start as soon as you're both in. Sign in with Google or Discord to keep your progress across devices.
Play at twin.sosnovich.app →