Skip to main content

The Shindig: A PICO-8 party

· 4 min read
beho

As part of the PiCoSteveMo game jam I'm planning to build a deck builder game where you host a great party.

This is the development log of working on this. Follow along with me as I try to build this out.

2025-11-02 1800

The game jam technically started yesterday so I'm a day late to the party. Tomorrow is a national holiday so maybe I can do some catching up.

I've downloaded PICO-8 and I'm going to start by trying to model some of the game state of the party. The meat of the game happens in three stages:

  1. you let people in to the party;
  2. you calculate the score for the party; then
  3. you spend credits to improve future parties.

I'd like to focus first on the calculation logic.

First I'll set up a git repo with a symlink to the PICO-8 cart.

# in PICO-8 save a fresh new cart
save the-shindig

# in the shell move the cart to the repo
mv ~/.lexaloffle/pico-8/carts/the-shindig.p8 ~/src/the-shindig/
# set up a symlink to PICO-8 carts directory
ln -s ~/src/the-shindig ~/.lexaloffle/pico-8/carts/the-shindig
# verify that it worked
ls -al ~/.lexaloffle/pico-8/carts

# in PICO-8 again load the cart
load the-shindig/the-shindig.p8

I'm symlinking a whole directory because I think I want to eventually be able to split out the source files.

The repository exists! https://git.sr.ht/~beho/the-shindig

1830

OK I think that worked. Let's write some code.

I want to be able to edit the logic in a separate file so I opened the editor (ESC) and added

#include main.lua

It turns out the code examples in the PICO-8 docs are rendered with capital letters but should be written lowercase in imported lua files.

The three hooks into the game runtime are:

function _init()

end

function _update()

end

function _draw()

end

I started by adding adding a table of guests and some print logic for outputting to the screen.

  -- fun, mon, sca = fun, money, scary
guests = {
{ name = "alice", fun = 1, mon = 0, sca = 0 },
{ name = "bobby", fun = 2, mon = 0, sca = 1 },
{ name = "sandra", fun = 1, mon = 1, sca = 0 }
}

Each guest will contribute to the party score based on their statistics.

Printing to the screen was proving to be chaotic it looks like I need to clear the screen on each draw.

It turns out there are special control codes for this:

-- clear the screen to pink
print("\^c2")

1900

OK this seems to be working:

a screen with some statistics

Maybe next we can focus on adding a guest to the party with the player presses a button.

The way iterators work in Lua is a bit different than what I'm used to. This ipairs keyword got me what I needed:

for index, guest in ipairs(Guests) do

2330

OK either I was very satisfied with that or I was scared of what came next. Getting back to it.

It turns out there's a cls method for clearing the screen.

I think it will be simple for now to keep a list of friends that will show up to the party. Then whenever a new guest arrives we pop them off the friend list and push them to the guest list.

By using two stacks of friends we'll be able to support peeking at the next guest too.

Tables in Lua are new to me. To pop from a "stack" it looks like we can use the deli method.

I can't get this picture of two stacks of pancakes out of my head. If the order is predetermined then maybe we can just keep one array and a pointer to where we are at.

Everything before the pointer are guests who have already arrived. I guess I'll learn about tables later.

Now are the indices zero based in Lua?

Also helpful is the btnp method in pico-8 for detecting not just if a button is down but was pressed.

2400

I'm fairly happy with that as a first start. I'm able to:

  1. add guests to the party and
  2. calculate the total score for the party.

I think next I'd like some more visuals. In particular I'd like to think about how to model cursors moving around lists. I'd also like to represent guests as cards since this is a deck builder after all.

Thanks for reading!