Portal 2D: 53 Chambers, All Solved Before You Arrive
A pixel-art portal puzzler written from scratch in C#. See-through portals, lasers, a map builder, and a bot that plays every level before you do.
October 21, 2026 ยท Labs
A pixel-art puzzler where the portals are real, the physics is honest, and a bot has already beaten every level.

Welcome, test subject. Please keep your hands, feet and momentum inside the portals at all times.
Portal 2D is a side-scrolling puzzle game about two holes in the wall. Fire one blue, fire one orange, and anything that goes into one comes out of the other. That is the whole idea, and it turns out to be enough for fifty-three test chambers.
It is also a Labs experiment that got out of hand. Every sprite, every tile, the lettering and every sound effect is generated by code. It runs on Mac, Windows and Linux, it is free, and the code and the releases live on GitHub.
Chamber 01: Fling
The first thing to learn is that portals keep your speed. Fall into one and you come out of the other at the same speed, in whatever direction that portal faces. Drop from higher and you leave faster. Put the exit on a floor and you are thrown back up.
That little sandbox runs the same rule the game does. A portal sits on a wall, a floor or a ceiling and has an outward direction. Going from portal A to portal B turns A's direction into the opposite of B's, and position and velocity both go through that one turn. Try the ceiling: the turn is nothing at all, so you simply keep falling, faster and faster. Try a wall and you are fired sideways.

Chamber 6, Speedy Thing, in the real game. The momentum comes through the portal with the subject.
In the game, that one rule also carries lasers, decides which tiles stop being solid as you sink in, and drives the picture of the room behind each portal.
Chamber 02: Look through it
In most games a portal is a sticker. Here it is a window. Once both are open, each one swells into an oval lens that shows the room in front of its partner, squeezed through a fish-eye curve, shifted a little as you move so it has real depth, with ripples, a swirl and a dithered, sparkling rim.

Chamber 1, Awakening. Each lens shows a live view out of its partner.
Under the shine is a simple trick. The world is drawn a second time, through the portal's transform, into an off-screen picture. The lens is a shader that samples it. Characters passing through are redrawn on the room side, so they never vanish behind the glass.
Chamber 03: Light, bent
Lasers travel through portals too. A beam that hits a portal face carries on out of the other one, so the puzzle becomes working out where to put the doorways so the light ends up in the receiver. Mirror cubes, glass and ceiling lasers add more ways to bend it.

Chamber 9, Relay. Lasers go through portals, so you can redirect them into receivers.
The rest of the chamber toolbox is just as small and just as combinable: weighted cubes and buttons, toxic goo, emancipation grids, blue repulsion gel, orange launch plates, orange speed gel and timed buttons. A new idea turns up every few chambers, and then the later chambers combine them.

Chamber 13, Two Weights. The first forty chambers are handcrafted, each with its own trick: shooting portals through a window, using a cube as a step stool, a sealed cell, a speed loop, a level with no portal gun at all.
Chamber 04: The one that never ends
Random Test builds an endless run of chambers out of dozens of puzzle rooms. Every run gets harder, harder rooms only unlock as your streak grows, and the game remembers your best.

Random Test, streak 1. This chamber was made a moment before it was played.
Randomly generated puzzles have a classic problem: some of them cannot be solved. Portal 2D does not hand you one until it is sure. A bot drives the real physics with scripted inputs. Every handcrafted chamber has a reference solution, and a single command plays all of them with no window. In Random Test, each type of room writes out the inputs that solve it, and a new chamber is only given to you after the bot has finished it. If it fails, the game tries the next seed.
So when you are stuck, you are stuck on a puzzle with an answer.
Chamber 05: Build your own
A point-and-click map builder lets you design chambers of your own. Paint walls, glass, goo, gels, lasers, cubes, buttons and doors. Wire doors to buttons and targets by colour and number, and the editor draws the link lines and warns you about doors nobody can open. Undo, redo, resize, pick the portal gun you allow, then test play.

Chamber select. Beat one to unlock the next.
Maps save on your device. To share one, beat it first, so everything shared is known to be finishable, then copy a single line of text and send it to a friend, who pastes it in. There is also a Featured Maps screen with hand-picked chambers, six to start, hosted on the game's GitHub page.
If you would rather play with one hand on the mouse, an option makes left click fire blue, then orange, then blue again.
Made in four days
Portal 2D went from nothing to its seventh minor version in four days. Drag along the line to watch the chamber count climb and the mechanics arrive.
Pixel art out of nothing
The game ships no art and no audio files. Tiles and sprites are painted pixel by pixel into buffers in code, the lettering is a bitmap font built by hand, and every sound effect is synthesised. The picture is drawn on a 640 by 360 canvas of 16-pixel tiles, then scaled up by a whole number with no smoothing, which is why it stays crisp. Each level's walls are baked with outlines, rounded corners, panel seams and a painted chamber number.
![]()
Everything on this sheet is drawn by code.
The test subject in the sandbox above is the first frame from that sheet.
Your turn
You can run it with these:
Then take it for a spin. It is free for any non-commercial use, and after the first install it checks for updates when it starts and offers to download and restart into the new version.

Chamber complete. Your best time is kept for next time.
The fine print
Portal 2D is written in C# on .NET 10 with Raylib, about nine thousand lines of it. The code and releases are at github.com/xandertaylorx/portal-2d-game, and you can read how it works in the README or grab a build from the releases page.
It is released under the PolyForm Strict License: you can download, play and study it for any non-commercial purpose, but you cannot sell it, modify it or redistribute the code or builds without permission. Portal 2D is an independent fan project. It is not affiliated with or endorsed by Valve Corporation, and Portal is a trademark of Valve Corporation.
Portal 2D lives in Labs, with the rest of our experiments. Press R to restart a chamber, as often as you need to.