The Shindig: Getting acquainted with the sprite editor
As part of the PiCoSteveMo game jam I'm building a deck builder game where you host a great party.
The last time (see day 2) I worked on getting an initial design for the main game screen in Aseprite. This time I'll have a go using the PICO-8 sprite editor to recreate it in the game.
Initially I directly imported the whole 128x128 screen into the PICO-8 sprite editor. but it turns out that is the memory I have for all sprites!
Still it's nice to be able to print the entire roof directly from the sprite sheet.
sspr(0, 8, 8 * 16, 8, 0, 0, 8 * 16, 8)
I get the feeling I'm going to get very good at multiplying numbers by 8 and 16. 8 is the number of pixels in a tile and 16 is the number of pixels in a row.
So I need to get creative in paring this size down. First of all it looks like Aseprite has a tilemap export removed any duplicates. This brought the size down by three quarters but I think we need to make it smaller still.
Playing around with painting on the screen it looks like I can directly print a plain background for the sky using rectfill.
-- night sky
rectfill(0, 0, 8 * 16, 15, 1)
And similarly we can model the stars as 1x1 rectangles.
-- stars
rectfill(3, 7, 3, 7, 10)
rectfill(12, 5, 12, 5, 10)
rectfill(20, 2, 20, 2, 10)
For the roof it's mostly one row of the same sprite
-- draw roof second row
for x = 0, 16 - 1 do
spr(21, x * 8, 8)
end
I don't like how I'm making lots of hard coded references, but maybe this is the feeling of liberation?
I can apply the same approaches for the rest of the screen and now our sprite sheet is looking a bit cleaner. I probably don't need most of these brick sprites either.
I found one more method that saved me some time for the text box border (except I did it the long way first already, whatever).
There is a rounded rectangle function, which with a radius of 1 pixel will render our border.
rrectfill(
8 - 2, 12 * 8 - 2, -- x, y
14 * 8 + 4, 3 * 8 + 4, -- w, h
1, -- radius
13 -- colour
)