Bonus Stage 1K: a Pico-8 demake of the iconic spherical bonus stages in Sonic games, in 1024 bytes of compressed lua code. Produced for the 2022 #pico1k jam.
Help Jelpi navigate a spherical maze by turning left or right at the end of each tile, collecting rings and blue spheres while avoiding the lethal red spheres. The game finishes when no blue spheres remain.
A lot of shortcuts had to be taken in order to make this fit in 1K. I was originally planning to animate the background with palette cycles, but soon realised I had nowhere enough available colours or space in the sprite sheet to do this. Instead, I had to use precomputed coordinates and include much more verbose code to do the transformation and colour mapping.
Another unsavory shortcut was to replace the back to front sorting of the objects by something approximate which works 'most of the time' (C). I will also submit the original version of the cart, which does this correctly, as soon as I can add some comments to it.
@freds72: thanks for the suggestion, that would work but we would need multiple sspr calls per column as the scaling ratio will change based on depth.
Alternatively we can render the tiles as quads using lines, which should much cheaper than the pset. Currently the cart was at 151% of a frame (a bit more once I removed a few locals), so 100% should be achievable that way. I will give a try to see how compact I can get quad rasterisation.
With this change there is plenty of room to run this cart even at 60fps, which opens up the opportunity for a very smooth full fat implementation. This lacks the elegance and ingenuity of the tline-based implementation above, but unfortunately that would not provide the spherical distortion as cells fade away in the distance, which is much more prevalent with the perspective used in the reference game.
Please note the cart below is a bit different from the 1K version (it is an earlier version which is easier to edit).
ah! this is actually @p01 trifill and suggest you switch to my n-gon rasterizer!
it natively supports quads and won’t have the edge artifacts you now have.
and shl/shr are ‘obsolete’ - use >> << (+ faster)
Better borrow from @freds72 for real. His n-gon rasterizer will work much better for your use case, and it does sub-pixel precision which allows much smoother movements.
That said, kudos on your 1k entry. It's pretty neat!
The 60fps is smooth as butter:
the irony is that the source material most likely implemented this with palette cycling, and if memory serves me well, it may have been running at 15 fps (even less in PAL). I need to play it again with an instrumented emulator, also to figure out the controls, specifically how many frames before the edge of the tile did it registered the turn. Either it was quite hard or my teenage self was very lame.
[Please log in to post a comment]