Infinite Blocky Runner: A Game in 256 Bytes!
The challenge was to come up with a Sinclair ZX Spectrum game in 256 bytes without using ROM routines, so the entire game is self-contained - input handling, rendering, data, code, everything. For reference, 256 bytes is about the size of this ray gun sprite, which is 16x16 pixels at 1 byte per pixel (256 colors):
Here’s my entry, “Infinite Blocky Runner“ (see below).
I've posted the source code for this on my Github here.
At the very least, this effort fits in (exactly) 256 bytes. I know of a couple of issues (the progress bar at the top will probably wrap in odd ways, should you progress far enough). There’s no audio, no difficulty progression, but you can at least die and restart.
The approach I have taken here is basically to use zero data, everything is procedural. I've taken advantage of the fact that the Spectrum display is organized as a 1-bit bitmap with a 16-color attribute table, each attribute corresponding to an 8x8 pixel block, and so I am updating the attribute table only.
I should add that I’ve embedded JSSpeccy, the JavaScript ZX Spectrum emulator here in order to run the game. Let me know if this is working for you in the comments!
Press a key to jump. Enjoy. 🙂note: will not work on mobile devices without a keyboard.
Press a key to jump. Enjoy. 🙂note: will not work on mobile devices without a keyboard.
Crosswize on the Sinclair ZX Spectrum |
If you enjoy my blog, you can help support it by buying me a coffee!
Comments