PICO-8 Fantasy Console


Categories: Development


PICO-8 is a 128x128 4-bit fantasy console that can be emulated in the browser. Developers create .png cartridges that can be loaded on the emulator. This page is going to be a hot mess for a while, right now it’s just a rambling series of notes until I can whip it into something informative.

I decided I wanted to get back into making small games and after tinkering around with this console I found I was having a lot of fun. The constraints narrow the scope nicely, making it useful for small projects and jams.

The console font is difficult to read, so I edit the .P8 file in Atom (language-pico8 package) and use Ctrl+R to run the cart after code changes. I would like to use an external tile editor, like Tiled, but I haven’t figured out a workflow yet.

MBoffin’s Top-Down Adventure Tutorial has been a wonderful resource, his code is easy to follow and I have been able to combine his top-down tutorials with his projectile example.

One thing I did struggle with in this early game was pixel location vs. tile location. If there was an issue with say collision detection, it had to do with conflating the two pos values.

I came up with a hacky visual way to place and generate enemies rather than keeping track of the tile coordinates. I mark the map with a tile I’ve identifed as “slime”, and on init the game iterates over the entire map and places the enemy sprite. This only works for stationary enemies, which is fine for this game.

function make_enemies()
  for x=0,128 do
    for y=0,64 do
      if (is_tile(slime,x,y)) then