I'm a newbie and I'd like to learn procedural generation to add things like dynamic grass and vegetation to my game. I really like how Zep created the swaying trees in the fireflies gif for the 0.2.4 release, so I thought I'd examine his code. But I'm having some trouble parsing it because the function seems to call itself. I'm assuming this is what's called a recursive function.

How does the function know to stop calling itself? I'm guessing the if statement regarding the l variable terminates it but how? I'm confused because, to my mind, logically, there should be an "else" following the if/then to call the function again. What is the point of the return command?
Here is his function for drawing the trees:
function tree(x,y,a,l) if (l<3) then for ii=0,3 do circfill( x+rnd(8)-rnd(8), y+ii, 1,lcol[4-ii]) end return end local x1=x+cos(a)*l local y1=y+sin(a)*l local q=l/8 local col=l>8 and 13 or 0 for xx=-q,q do line(x+xx,y,x1+xx,y1,col) col=0 end local d= ( cos(t()/3+x1/50)+ cos(t()/4+x1/70) )/500 tree(x1,y1,d+a-.04-rnd(0.04),l*(.9-rnd(0.2))) tree(x1,y1,d+a+.04+rnd(0.04),l*(.9-rnd(0.2))) end |
Thanks!


Tunedle
A Musical Wordle Tribute
A little melody game where you have 6 attempts to guess a random melody with wordle-like feedback. "Easy Mode" will add note labels to your previous attempts. When Easy Mode is off, you have to play by ear (and can only listen to your last attempt).
This was a fun to put together and I am fully incapable of playing this game with easy mode off, but I figured for some more talented and musical people it might be a fun challenge.
Hello,
This Sunday, I purchased the discounted version of Picotron for $12, but I haven't received an email regarding the transaction or the license in my account (have pico8 and voxatron on this)
Monday, my account has been debited
I don't see picotron on the download page or even received a key by email, I sent an email on Sunday to [email protected] but I didn't get a response.
Thank you for you help


Haven't had any issues with connection before, but today it seems that no matter what I do, trying to [update] any of the lists in splore leads to a 'could not connect to BBS' error. I downloaded a fresh zip of pico-8 and renamed my appdata/roaming/pico-8 folder so that it would generate a new one with all the defaults. I also set pico-8.exe as an exception in windows firewall, and just for the heck of it I also set both the program folder and the data folder as exceptions in windows defender virus protection (I also tried it with both virus protection and firewall turned off), and just in case I made sure neither were read-only. I also disconnected and reconnected to the internet, somehow none of these have resolved the error, and I'm not finding any other suggestions (aside from linux-specific commands, and this is running on windows 10). Hoping someone has any idea what else it could be!
MARIO BROS. PICO
This an update of the Mario Bros. arcade game that was rereleased for later consoles as Mario Bros. Classic.
Play as Mario or three unlockable characters!
How to Play
Move with ⬅️/➡️ and press ❎ to jump.
Flip enemies onto their backs by jumping to hit the platform beneath them. Once an enemy is flipped, send them flying with a kick! Boot enemies in quick succession for more points.
Update Log
1.1 - Added persistent cart data for hiscore and unlockable characters








"This is the end... the last stand."
— General Keros, 3789ac
The spores have breached the dimensional veil, threatening all of humanity. You are the final line of defense. Blast them, crush them with your ship—destroy them by any means necessary! Not one spore can pass the radius. If even one does, the bomb will detonate, erasing everything in range. But what if we run out of bombs? Then it's truly over.

Gameplay:
- Left/Right Arrows – change the direction of the rotation.
- X – Fire your guns; hold to charge a powerful shot
- Y – Hyperdash through the core, slicing through any spores.
In this project, you control a shark swimming through an ocean filled with fish. The fish move automatically in a group, trying to stay close to each other while avoiding collisions. If you get too close, they scatter and try to flee. The goal isn’t to eat the fish, but to observe how they react and behave based on your movements.
This might've been done before, but nonetheless, this is my attempt to make a functional neural network to recognize handwritten digits in pico8, using the MNIST database. The training is all done in Python using NumPy, I then use post-training quantization to convert the parameters into 8 bit integers which are then imported into the cartridge via the spritesheet.
It's pretty stupid (I think mainly due to the fact I do zero post processing on it, other than scaling it down with Lanczos resampling), but I find that if you try to only draw in the middle like I did in the label, it works alright.
You just draw with the mouse within the blue rectangle, then x to predict the value, and z to clear it.
Flip Flop
By Carter Dean
Controls
X: Jump
O: Flip Gravity
Arrows: Navigate Menu
Goal
Try to get as far as you can. The game speeds up as you go. Compete against yourself and others on the local leader board for a high score.
Credits
Game completely made by Carter Dean
Thanks to Maeve for introducing me to PICO-8
Find her stuff here: https://meivuu.itch.io/, https://www.lexaloffle.com/bbs/?uid=51001#m
Changelog
v1.0: Initial release.
v1.1: Small patch that added a light acceleration curve to make the strategy of holding 'O' not viable.




As the title says, attempting to unpod the string, "str", whether typed directly or stored in a variable causes either an out of memory error, or fully crashes picotron to the desktop - though the latter is rarer.
Attempting to unpod other strings just returns nil, which seems like the behaviour I would expect?
I've not found any other strings which cause this behaviour.
Hope this is helpful!
