The more lua code I write in the pico-8, the more general purpose functions I wind up discovering. Here is my current utility library, I'll probably continue adding more as time progresses.
Quick sort
This one is pretty straight forward, you simply call it by providing a table and an optional comparator (for non-numeric lists), and it will in-place sort your table. It currently does not return anything, but it could me modified to return the table passed if you want to chain things.
-- Inplace quick sort
function qsort(tbl, cmp, first, last)
first = first or 1
last = last or #tbl
cmp = cmp or function (x,y) return x - y end
if (first >= last) then
return
end
local pivot, pv, tail = first, tbl[pivot], last
while pivot < tail do
local tv = tbl[tail]
-- Tail is smaller than the pivot
-- Shuffle things around
if ( cmp(pv, tv) > 0 ) then
tbl[pivot], pivot = tv, pivot + 1
tbl[tail] = tbl[pivot]
end
tail = tail - 1
end
tbl[pivot] = pv
qsort(tbl, cmp, first, pivot - 1)
qsort(tbl, cmp, pivot + 1, last)
end
|
Quick update to remove the need to use cursor keys and z to draw. The circles only draw on the X axis I think cos/sin to do those pretty curves you see in graphs
I was inspired by the last p8jam and wanted to simulate a pebble dropping in a calm pool of water.
You can imagine my surprise when I held down z and moved around :D

The first PICO-8 Jam has ended, and peer ratings have been tabulated and verified. Thanks so much to all participants for making the jam a wonderful event and for producing an excellent collection of rain-themed cartridges. It was a close one, with only a difference of 0.04 PICO-8 stars (out of 8) between the two highest-rated entries. With an average of 6.92 stars, the winner is.. drumroll..
Frog Home! By JTE! white noise cheering sound
Congratulations JTE, and you'll be receiving a small prize in the mail from PICO-8 HQ -- a commemorative plastic coaster depicting your cartridge, along with a PICO-8 canvas bag.
With an extremely close 6.88 stars, is Benjamin Soulé's Rainmaker:
Also close behind were Rain Culture by NuSan, Tea by moonmagic, and the equally heart-melting Rainy Day Friends by electricgryphon.
Stay tuned for the next Jam, which will be in the first quarter of 2016. And if you're not burnt out from jamming or missed this one, join me for Ludum Dare this coming weekend!
You can view all of the P8JAM1 entries here, or directly play the carts mentioned in this post below.

This is week 4 of my blog series where I'm making a pico8 game every week.
Controls:
Arrows to move/navigate menu
X to open menu and select actions
Z to cancel menu
Actions:
Hunt: Get meat, in spring you don't lose hunger due to finding berries.
Chop Wood: Gather wood for building fires in winter
Build Fire: Build a fire using 2 wood, in winter fires are required to keep from freezing to death. You also only regenerate health when full health, 0 cold and near a fire.
Eat: Eat 1 meat to restore 3 hunger points.
If your health reaches 0, or if you get as cold as your remaining health you lose.
This game is meant to be rather hard, but I didn't have time to balance it. So it may or may not be hard at all.
You can find my blog post here: quidditycode.com

I was thinking about how one might make an interesting game involving ferrying passengers across a river. Then I got sidetracked by making imagery inspired by the ferry across the river Styx and the little fog lamp... This is kind of unusual for me, just posting a non-game cartridge, but I like how the clouds came out.
I might still make the ferry game, but I don't know if it will be about Styx or the underworld. I have quite a few ideas though, mostly involving crowded passengers and monster attacks.
TL;DR : It's an art cartridge, this is all it does, I might make a game out of it later.

This is a first attempt to render textured height maps in something close to real time. I guess these would be considered voxels?
I am casting rays from the screen and checking intersect with the floor plane to get an x,z coordinate. Then I load a pixel from the map for the color and a pixel from the map at an offset location to get a height value.
A neat feature is that shadows could be baked into the texture.
Code is ugly, buggy, and poorly optimized...
Issues:
--In order to keep the frame rate up while moving, I had to double pixel size.
--Looking up a pixel on the map is very slow, but I want to be able to handle 512x512 height maps and this is the best way I can think of. (512x512 color map and 512x512 height map)
--tall vertical walls jump in and out of existence, especially when at a distance. Actually, this happens with all pixels. Rounding errors perhaps?
I'm going to look at Zep's Raycast demo and see if there is anything in there that I can borrow.
-ElectricGryphon

Still working on it, but it's gotten to the point where all major features have been implemented and it's winnable.
Instructions:
[hidden]You're solving a bomb with a certain number of digits (depending on how many you choose), by rewiring and replacing modules. How hard could that be?
Panel overview:
You'll view a grid of 4x5 panels, each corresponding to an element in the number, as you solve circuits, the panels will change to green and represent a part of the number. When you're confident in what the number is, press X and select the number. You can only do this when you've solved two circuits. Each panel must be guessed correctly to win the game, and if you guess incorrectly ... well ...
The circuit:
Pay attention to what flashes briefly, as it won't be said again until you complete a module. Go from 1st to 2nd to 3rd, cutting each side of the module, removing the old one, and soldering the new one on. When you're "cutting out" the modules, you replace the module you're working on with a wire (the grey rectangle), and if you're "replacing" them, you replace it with one of either same shape or same color. It won't be both, and you might have to try either to figure out what the circuit wants. Once you figure it out, every other module will follow the same rule.
No you can't just cut off a side of the circuit and then resolder it, that won't work.

Controls:
- left/right/up/down to move cursor
- Z to mark a square
- X to flip between cursor mode (0 - nothing, 1 - cross, 2 - mark)
Just uploading this stupid thing I got sidetracked with and made today. I'll probably continue with it and flesh it out, just not sure when. At the moment it has 3 puzzles (2 of which were shamelessly stolen from Picross DS (pls dont tell anyone)) and which one you get when you boot up the game is random so keep rebooting the player until you get a different puzzle.
If you don't know how to solve Picross puzzles, this page might be a good start.
TODO:
- win state
- main menu & puzzle selection menu
- automatically mark numbers as rows/columns are filled in
- better controls
- tutorial (?)
- sounds, music and a plethora of juicy effects
- code optimizations to be able to fit in as many puzzles as possible
Hi,
Before there are hundred of similar cartridges...
I want to wish you a Merry Christmas!
Have a lot of fun with your familly.
I kiss you all ;-)
Thanks for the greater good that you give every day to the community <3
Many thanks to zep (for this strange and wonderful thing called pico-8)
Kind regards,
jihem

Hello, this is my first attempt to code anything in this great virtual console.
It's just four effects I coded in my first few evenings since I bought the Pico-8.
I try to use the special modes at 0x5f2c to mirror some of the effects so that I have to draw less pixel.
Although, one can use the keys to go through all the modes, and based on the mode more or less pixels are drawn and the text are aligned accordingly.
A: changes mode
B: changes part

I keep thinking of old ST/Amiga era game styles that I'd like to experiment with in Pico-8 but a lot of them need mouse support.
Are there plans to add mouse support? Is there already mouse support and I've missed it? Is this a terrible idea and should I get my coat?
To me It seems a bit strange to use the mouse in the editors and then it be not available in game.
D

(this message is translated in French and also is in english / ce message est traduit en anglais et il est aussi en français)
Is my first one day sure Pico-8 ! C'est mon premier jour sur Pico-8 !
I do not create of game, but I surly create games later ... Je ne créer pas jeu, mais j'en crérai surement plus tard ...
Follow-me if you want to receive my next games ! Suis-moi si tu veux recevoir mes prochain jeux !
Bye !!! Au revoir !!!
Valérian

This Wednesday, I opened one of my pico-8 in notepad and realized how simple the format is. I immediately wanted to build tools that write cartridges. The idea that hit me was this: It can be hard to make multi-screen scrolling levels or title screens from tiles, because every image has to be composed of tiles, it would be easier to just paint the image in photoshop, and then have a tool break it into tiles, eliminate duplicate tiles, and write the result into a cartridge file.
So I got started, first step, a bit of code that scrolls a map around the screen. Secondly, make some art that uses the pico8 palette. I made a JASC PAL file based on a screen shot, and used PSP8 to dither the old red-eyed tree frog that's used so much in image processing.
Then wrote some code to read the resulting PNG, break it into 8x8 tiles, and write tiles and resulting map into a cartridge. I'm already writing Lua here, so I used LÖVE, which made reading image files and looking at pixels pretty easy, even though it's not what it was meant for, but who has time to write all this stuff in SDL and C? So that wasn't too hard, and by end of day, I had put up a proof of concept:
Navigate with arrow key, speed up with the first button (keyboard Z or controller A).
The code that generates the cart is really awful, everything happens in love.load(), and there is a ton of string processing that's about as inefficient as you could make it if you wanted to, and the resulting cartridge had way more tiles than you need, because duplicate elimination wasn't done yet. Gotta save some work for version 1.
I've been playing around with the map editor and I've even managed to stick Betsy at the bottom of the screen. I used some ball code from Squash code in pico-8 fanzine #1.
There's no collision detection, so raining on Betsy does nothing. She's also at a fixed y position so the platforms have no effect too.
Update: I've managed to make a pig's ear of the cart title!
Update #2: Wahey posted to the wrong user blog!






6 comments


.png)







