Log In  

Cart [#33354#] | Copy | Code | 2016-12-11 | Link

My entry for Ludum Dare 37 (theme: one room).

You're an interior decorator, and your job is to give your clients nice and shiny new homes. Take note of their demands and try to give them exactly what they want.


  • a whopping 8 different pieces of furniture!
  • a massive two (2) unique clients!
  • almost 30 furniture styles!


  • arrow keys: move cursor/select item and style
  • Z (circle): new item/pick up item/place item/confirm/continue
  • X (cross): finish decorating/delete item/cancel

Feel free to post screenshots of any neat rooms you decorate!

Not entirely satisfied with this one, could have gone further with it but I started losing motivation toward the end. I think it's a neat concept and I have some unexplored ideas on where it could go next, but I'm doubtful I'll keep working on it post-jam.

The cart is released under CC4-BY-NC-SA, so if you want to remix it or expand upon it (like adding more furniture or clients (or just cleaning up the spaghetti code)), I encourage you to do so.

ludumdare ld37
P#33355 2016-12-11 16:59 ( Edited 2016-12-18 04:12)


Cart [#28607#] | Copy | Code | 2016-09-16 | Link

Inspired by LRP's lowercase font, I made a little library that lets you print to the screen using a custom 9px variable-width font that is defined entirely in code. In other words, nice and readable text that doesn't use sprites. The cartridge includes the hastily coded example usage you see above.

What's included:


    initializes font data, must be run before print9() can be used

print9 str [x] [y] [col]

    prints to the screen using a variable-width 9px custom font
    if x or y are left blank it will continue printing where it last left off
    col is text color

    optionally returns the x-coordinate of the cursor, which is useful if you
    want to continue where you last left off (for example, when typing one
    character every frame)

    do note that print9() uses up a reasonable amount of cpu, typing out the
    entire lowercase alphabet uses up about 10% of the cpu @ 30fps
    my suggestion for longer text (i.e. dialogue boxes) is to draw to regions of
    the screen that are not cleared every frame and only clear when necessary

is_bit_set var pos

    checks if the pos-th bit (including fractional part) in var is set or not
    used internally by print9(), but hey, it's a nice utility

With all (non-extended) characters defined, this library uses up 847 tokens. If you are desperate for tokens, it works perfectly fine to remove the definitions for characters that you don't need, for example only defining lowercase characters + punctuation can cut it down to ~450 tokens.

Explanation for how the characters are defined:

The font data for each character are tucked away in regular Pico-8 numbers treated as bitfields. The bitfield is divided into two parts - an 11-bit header and a variable length body used as a binary bitmap. Here's what the data for the letter "e" looks like on a binary level: To be able to store more data than can be contained in a single 32-bit number we split each character up into table items, so that when we reach the end of the first item we can simply jump to the next: Let's look at the header. If the 0th bit is set, the character has an ascender. If the 1st bit is set, the character has a descender. A character that has neither an ascender nor a descender is 5px tall. A character that has an ascender extends 2 pixels upwards and adds +2px to the total height. Likewise, a character that has a descender extends 2 pixels downwards and also adds +2px to the height (a character can have both an ascender and a descender, which makes it 9px tall). The following six bits (2 through 7) are what I like to call "kerning data" and tell us whether the character "sticks" out in the top (ascender, red in the above picture), center (green) and bottom (descender, blue) regions on either side of the character: bits 2 through 4 for the left side and 5 through 7 for the right side. Let's use lowercase "d" as an example: bit 2 = 0 because the left side of the character does not occupy the top region bit 3 = 1 because the left side occupies the center region bit 4 = 0 because the left side doesn't occupy the bottom region bit 5 = 1 because the right side occupies the top region bit 6 = 1 (right side occupies the center region) bit 7 = 0 (right side doesn't occupy the bottom region) When print9() prints a character to the screen, it compares the left side of the character to be printed with the right side of the previous character. If both characters have parts that occupy the same regions (for example, "E" and "B"), there will be a 1 pixel gap between them, but if there is no match ("T" and "e") there won't be a gap (0 pixels). Let's continue looking at the header: bits 8 through 10 is simply a 3-bit number (0~7) that determines the width of the character plus 1. In other words, this means that a character can be anything between 1 and 8 pixels wide. The character "e" in the topmost image has these bits set to 011 = 3. Add 1 to that and we get a 4 pixels wide character. The body is a very simple bitmap structure that runs from top-to-bottom, left-to-right and tells print9() whether to draw a pixel (1) or not (0). Because we already calculated the height (5 px + 2 if asc + 2 if desc) and width (1 + value in bits 8-10) by looking at the header, the function knows when it's time to hop to the next vertical line and when it has reached the end of the character. If we reach the final bit of the first number we simply jump to the first bit of the next item in the table (as described earlier) (as a bonus, Pico-8 doesn't crash if we use binary operations on a nil value, meaning that if a character wraps over into a second table item but there's no data that needs to be defined in it (all zeroes from here on out) we don't need to define it and save some tokens. Woo!). To simplify, here's the bitmap for the character "e" from the earliest example and how the function treats it: That's it! That's all you need to know to create your own characters. My suggestion is to first map out your characters in the Pico-8 gfx editor, then use some calculator with a bit toggler (Window 10's default Calculator has one if you switch to programmer mode) to map it all out and get a hexadecimal number. If you want to create characters that are more than 8px wide or with heights that aren't 5, 7 or 9px you will have to modify the print9() function itself, but you can probably figure out how to do so yourself (if not, feel free to ask and I'll try to help!).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Licensed under [WTFPL](http://www.wtfpl.net/faq/) (Do What the Fuck You Want to Public License). Use it, modify it, trash it... do whatever you want. I'm just happy you took the time to take a look at it at all. If you use it with one of your cartridges, or make any changes to the program to optimize it or make it suit your needs better, please let me know, I'd love to see what you do with it.
utility text font
P#28610 2016-09-16 13:20 ( Edited 2016-09-22 17:19)


Cart [#17760#] | Copy | Code | 2015-12-13 | Link

You're an unfortunate flower stuck hundreds of meters below the ground and you want nothing but to see the sun again again. You might never get out, but your children may!

Shoot your seed and have it land safely to spawn a child who carries on your legacy. Shooting your seed kills you and leaves your withered body behind and if the seed is destroyed, your bloodline ends here and now.

This game uses only two controls; the left and right arrow keys.

  • When idle, hit both left+right simultaneously to take aim.
  • When aiming, use the left and right arrow keys to decrease/increase your shot strength, and hit left+right simultaneously to shoot.
  • If on the game over screen, hit left to restart the entire game or right to restart the current level.

The game only has two levels, but I'm liking this concept so I might continue working on it after the jam.

Legacy of Flower was made entirely in PICO-8. Special thanks to @zep for making such an incredibly fun fantasy console!

Thanks for playing!

ludum dare ld34
P#17758 2015-12-13 18:57 ( Edited 2015-12-14 04:52)

:: More
About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2018-10-24 04:31 | 0.318s | 1835k | Q:37