Table of Contents
In 1976, Atari wanted a Pong. They got a Steve Jobs, who had a Steve Wozniak. And four sleepless nights later, Breakout was built on a 44 chips board, in a company where 150 was considered a perfectly reasonable number.
Fifty years later, my version runs in a browser tab that probably eats more bytes than the Apollo 11 program. It’s called progress.
Press SPACE to launch the ball. Arrow keys to move the paddle.
Copying Breakout
As my retro game dev roadmap reaches 1976, I did the maths. My Pong already had a paddle, a ball and bounces. There was nothing to make Banjo grow with a project like Breakout, for everything was there already. I take it as a compliment.
So this time, I tested migration. Since AI lets me steal from thousands of developers at once, stealing from just one felt almost polite.
Someone on YouTube recorded their screen while coding Breakout in C with Raylib: no commentary, no downloadable source, just twenty-eight minutes of typing set to lo-fi, which is as close as the internet gets to a handshake. The channel is voidsrc, a C programmer “making things from scratch”. To be clear: the game design and the code below are theirs. All I swapped was the API underneath.
I transcribed the video. Pause, type, unpause, repeat. An hour of monk work, in which I was extremely productive and contributed nothing.
Then the swap: every Raylib call became a Banjo call. Two questions. How hard is it to move a game from one API to another? And what does mine look like, held next to a popular one?
The Findings
The migration was smooth. No bug, no surprise, the game ran on the first try, which in the migration business counts as deeply suspicious. Write your C in a straight line and the two APIs are interchangeable, up to vocabulary. To be fair, we only scratched the corner of Raylib that Breakout needs, and that corner is roughly all of Banjo. That’s fine, I can live with that.
The Oddity: Colors
In Raylib, a color is a value.
RED is yours: store it, pass it, print it, lose it in a refactor like everybody else.
In Banjo, colors are issued by the framebuffer at draw time, one transaction per call, valid nowhere else and not for keeps.
A color you can rent, not own.
voidsrc typed RED.
I typed a request to the small office that handles colors, which takes my RGB components, stamps something, and hands back a token I may use for one draw call and may not keep.
This is the one place I stopped copying and started dealing with paperwork.
Banjo will get colors as real values.
It’s on the list.
The Nicety: Text
Raylib draws text at a position. Banjo draws text in a rectangle, with alignment flags. For a scoreboard, that’s the better API: “Game Over” is a region, not a coordinate, and it centers itself, which is one less thing for a paddle game to get wrong. My font is basic, but the API around it held up. Full text support is coming, so this section will get a sequel.
The Verdict: Plumbing
Raylib is a framework: InitWindow, a while loop, BeginDrawing/EndDrawing.
Banjo is callbacks: setup, step, draw, teardown.
More plumbing, I admit it.
But a while (true) in a browser tab is not a game loop, it’s a support ticket, and the callback shape is precisely what keeps Banjo games off that particular help desk.
They compile for the web because the shape was right from day one.
The plumbing is longer, but it’s load-bearing.
Something Like Shaders
Banjo’s feature that looks like shaders is not new. It has been there since the dawn of Banjo, because The Book of Shaders, by Patricio Gonzales Vivo and Jen Lowe, taught me what a shader even is, and I have yet to learn anything without immediately wanting to bolt it onto something. It cost nearly nothing in my API, so it went in, because I could. Not the GPU kind of shaders: there is no GPU here. There is barely a computer. The whole idea is one callback, and one call to run it:
typedef int (*bj_bitmap_shading_fn)(struct bj_vec3* out_color, const struct bj_vec2 pixel_coord, void* user_data);
void bj_shade_bitmap(struct bj_bitmap* bitmap, bj_bitmap_shading_fn shader, void* data, uint8_t flags);You write a function that answers one question: this pixel, what color?
bj_shade_bitmap asks it for every pixel of the framebuffer, patiently, one at a time.
On a GPU, this is a shader running in parallel on thousands of tiny processors; on Banjo, it is a shader running in a for loop, which is the same thing in the way a paper plane is a 747.
It is the right tool for anything you can compute from a position: gradients, noise, fractals, animated effects.
And, as it turns out, for sunsets.
To pump the game up, I pointed it at Breakout: a synthwave sky, a CRT grille, glow on everything, and screen shake when things hit things. Breakout did not ask for a sunset. It got one anyway.
Same game, --shader on.
What I Learned
Unexpectedly, I enjoyed making this one. A normal game is inventing: game states, mazes, a font, the API itself, each with its own small crisis. This was transcription. Every decision was already made — the structure, the names, the order of the lines — and my entire job was to type them faithfully and stay out of the way, which sounds like nothing and felt like a holiday. It’s the difference between composing a piece and playing one: both end in music, and one of them you can finish in an afternoon.
The video had around forty views when I found it. If this post sends a few more views, good. A clean Breakout in twenty-eight minutes, the source published nowhere, nothing asked in return. The internet being, very occasionally, exactly what it was supposed to be.
Now it’s time to choose a game for 1977.