The Game That Fit Inside a Square
This wasn’t planned. It started with a quiet thought that refused to leave my head: what is the absolute smallest place a real game can live?
Not a link to a game. Not a download. The game itself.
I picked Flappy Bird because it doesn’t lie. If gravity feels wrong, you notice. If collision fails, the illusion breaks. If timing is off, it’s unplayable.
If this game survived compression, it meant the idea worked.
Step One: Removing Comfort
QR codes hate comfort. They hate images. They hate libraries. They hate anything that isn’t essential.
So I stopped thinking like a web developer and started thinking like a machine.
No sprites. No fonts. No frameworks.
The bird became a shape. The pipes became rectangles. The sky became a color fill. Everything was drawn again and again inside a single canvas.
A Hint of the Game’s Skeleton
That’s not the game. It’s just the bones. Enough to suggest what’s happening, not enough to give it away.
Step Two: When Code Stops Being Friendly
Once it worked, I started deleting things.
Variable names lost meaning. Whitespace disappeared. Anything the browser could guess, I removed.
At some point, the code stopped looking like something I would show anyone. But it still ran. And that was the only rule that mattered.
Step Three: Turning Code into a Scan
A QR code cannot run JavaScript. But a browser can open a file.
So I hid the entire game inside a sentence the browser understands: a data URI.
When scanned, the phone isn’t visiting a website. It’s opening a tiny, invisible HTML file that lives inside the QR itself.
The Tool That Made It Possible
This part didn’t happen in the browser. It happened in Python.
I built a small desktop tool that:
- Counts every character
- Encodes the HTML safely
- Warns when the QR limit is near
- Generates the final scannable square
And here’s the part most people don’t expect:
This tool is not limited to games. It can package any kind of HTML, CSS, or JavaScript — from demos and experiments to landing pages, interactive tools, or visual ideas — directly into a single QR code.
If it can run in a browser, it can live inside the square.
A Glimpse of the Logic (Intentionally Incomplete)
encoded = encode_html(code)
payload = "data:text/html," + encoded
if len(payload) > limit:
warn_user()
make_qr(payload)
Again — not the real thing. Just enough to show the idea.
This Is Where the Game Lives
Below is the square. Nothing is downloaded. Nothing is fetched.
Scan it. Open it in your browser. Tap the screen.
That’s it.
Behind the Scenes
People usually ask how I even knew when to stop cutting code. This is the screen I stared at for far too long.
Every character mattered. Every extra symbol had a cost.
Final Note
If you want to get the source code of Python tool, and the game behind this experiment, let me know.
Leave a like and drop a comment — your interest helps decide what I share next.
Comments
Haris (Author) #
Thanks for your interest! Please share your feedback here
Comment