Sphero

Published 2023-06-12


Version a1

Rescue Blocklandia from the evil clutches of Duke Cube. Find the nine golden keys to unlock the gate to the magic portal and recover the crown.

--Move the Sphero with the arrow keys
--Interact with special blocks by rolling over them
--Collect keys to open locked doors
--Collect floating coins
--Grab the crown to win the game!

If you beat the game, please post a picture!

There are some tidbits in this cart that might be interesting/useful to other pico8 programmers.

Level Storage

8X8 rooms are stored in a compressed format within a long string contained at the end of the P8 file. Blocks are stored in a manner that is closer to a drawing format-- e.g. change current tile, place tile at location x or fill a given region with tile. These instructions are tightly bit packed and then saved a single line of hex for each room.
This allowed for 117 unique rooms in the game with a reasonable level of detail before hitting the code compression limit. (15438/15616 in the end!)

I have tool to allow for rooms to also be stored in the cart data as well, but it didn't end up being necessary. (I got tired of designing rooms before I got ran out of space.)

I have a level editor (also made in pico8), which outputs levels to a text file, that I can share.

Sprite Packing

This game uses two sprite sheets worth of a sprites by mashing them together-- e.g. the first 2 bits code for sprite sheet one and the second 2 bits code for sprite sheet 2. I posted a demo cart of this earlier, and there are a couple of other carts on the bbs that explain this in more detail.

Physics

Collisions are handled using signed distance fields for the blocks in the local area of the ball, which make it really easy to check for where and when the sphere of the ball hits something--or multiple somethings. As a bonus, they also make it easy to find the normal at the intersection point, so bouncing type collisions are pretty straight forward.

I can do more of a write-up for these things if folks want.

-ElectricGryphon