A particle effect that spawns streams based on the music that's playing!
The song is a chiptune cover of "STONEFIST" by HEALTH.
It never stops repeating once it starts, but the music loop is maybe 45 seconds long.
Here's an example of how to do some basic stuff that reacts to music:
// pick a channel - a number from 0-3 // (0 is the far-left channel in the music editor) channel=0 // get the sfx index that's playing in this channel // (the number at the top of an enabled music channel's column) sound=stat(16+channel) // get the current timeline position of this channel (0-31) row=stat(20+channel) // get the two bytes representing the channel's current note byte1=peek(0x3200+68*sound+row*2) byte2=peek(0x3200+68*sound+row*2+1) // now we can extract the note values! // all three of these return 0-7 volume=band(byte2,0b1110)/2 effect=band(byte2,0b1110000)/16 instrument=band(byte1,0b11000000)/64 instrument+=band(byte2,1)*4 |

A barebones implementation of the FABRIK algorithm ("Forward And Backward Reaching IK"). Move the mouse around to control the IK target point.
I think there's something kind of cute and coincidental about the way that it actually sorta looks like fabric.
FABRIK is a clever trick that's surprisingly straightforward to implement, and it gives some really natural and performant results. The general principle is that instead of doing gradient descent or other fancy math for IK, you just imagine that your IK chain is a string (for 2D strings, imagine that they're resting on a table, and you're viewing from above).
At each tick, you perform two loops through the chain: First, you "pull the string" by the end point to the target position (and some amount of the rest of the string will get pulled along with it). After you've done this, you do the same thing, but this time, you pull the root of the string to the anchor point. (If the IK chain is a person's arm, then the anchor point is the shoulder.)
The source code also includes a 2D-distance check that tries to avoid number-overflow (by sacrificing some precision) when you give it a large enough vector. Might not be tuned perfectly (I really just guessed about the "safe range"), but maybe some motivated party can math out a more rigorous version of the function!

A weird animated image generator, based on the screensaver "Electric Sheep" (except way less powerful).
USAGE INSTRUCTIONS
Press Z to generate a new flame.
Press S to save the current flame.
Press X to view saved flames.
When viewing saved flames, press Up/Down to move the cursor between saved flames.
When viewing saved flames, press F to select/deselect a flame.
When viewing saved flames, press Z to load the selected flame (instead of generating a new one).
If you have flames selected and you close the saved-flame-view (by pressing X), then any new flames that are generated will be bred from the flames that you've selected (as parents).
For example: If you select one flame, close the selector, and generate new ones, they will all at least vaguely resemble the one that you selected. If you select more than one parent and generate new ones, then the new ones will inherit traits from all selected parents (plus some randomized mutations).
Post me your prettiest children in the comments!

A non-interactive view of a scene. It's roughly based on something I saw a few days ago, which reminded me of Virginia.
Some features:
- Infinite random props
- "Immediate mode" rendering - no spawning/deleting/pooling props
- Smooth LOD on tree leaves (more leaves on nearby trees)
Source code is commented, but the least-intuitive part of it (infinitely looping random objects) isn't really explained in there, because it would be a huge comment. Instead, here we go:
First, think of the casino signs with a ring of lights around them. When they light up one at a time in sequence, it can appear like a "single light" is "moving around" the sign, even though it's really different lights which are blinking at choreographed times. Our trees in this demo work similarly, but we can also move the positions of the lights separately from changing their states. Also, instead of on-or-off, each tree is given a persistent random seed.
Other than that, it's all pretty normal, I think?
I learned about L-systems the other day, so here's my first shot at making one. It generates a plant whenever you hit the main action button.
L-System Parameters:
axiom="a"
rules={}
rules["a"]={"b{c}b","c{b}c"}
rules["b"]={"a{a.}","a(bb.)"}
rules["c"]={"(ab.)","(b)"}
|
Constants are any characters that don't appear as a rule index - all rules for a given variable have an equal chance of being chosen. The generator runs five iterations for each plant.
A means "go forward," B and C mean "turn and go forward," {} and () mean "start a new branch and turn afterward," and . means "draw a circle."
All animation comes from the rendering portion - the L-system only runs to initially create the plant.

Just a simple little 2D-rotation example.
The function takes a 2D position (X,Y) and rotates it by ANGLE. CX,CY represents the center/pivot point.
The lines of code in the middle are the rotation matrix:
local rotx=cosa*x-sina*y local roty=sina*x+cosa*y |
This rotates a point around the origin. Before and after doing so, we offset our position by our center coordinate - this lets us rotate around any arbitrary pivot point.
For bonus points: When you're rotating lots of objects by the same angle (like a camera rotating, or a complex prop rotating), you can re-use your SINA and COSA values.

First real test-case for a 3D prop editor I've been making for Pico8.
There's no interaction in this demo - it's just four cars that drive around the screen. They also don't do any collision detection or avoidance, so they just drive through each other sometimes.
The point of the tool is that it lets you create and edit simple 3D props for use in Pico8 games. The editor is made in Pico8 so you can get a live preview with the same renderer that gets used in-game (crucial for lo-fi rendering!). The other reason that the editor is made in Pico8 was because it seemed like a funny thing to do.
If you clicked the link to the gif above, you may have noticed a familiar face - the tool can import triangle meshes, so that clip is showing a render of Suzanne (the test-monkey from Blender).
The workflow for making the cars goes like this:
- Make a car mesh in blender
This is a port of my favorite mobile game, which was originally designed by Area/Code Entertainment. Zynga acquired the original version, and they promptly ruined the minimalist experience with a bunch of abrasive and irritating hooks. On top of that, all of the clones I've found have been kind of janky.
Pico8 to the rescue! I'm trying to make the very best totally-free version of Drop7. Your feedback would be greatly appreciated!
INSTRUCTIONS:
Click to drop disks.
A disk is destroyed if its number is equal to the size of the group that contains it. A "group" is a horizontal row or vertical column of adjacent disks (like Connect-4, except with no diagonals).

Simple "Space Invaders" clone with some wacky special effects.
Left/Right to move, Z to fire.
Version 0.2
Did another stream, added some new features:
- Points system with perfect-wave bonus
- Permanent high score
- Infinite waves of baddies (gets progressively harder, to a certain point)
- Simple starfield background

Submit a high score screenshot in the comments to get your time and username included in the level select screen!
Version 1.0
- Two new levels
- Scene transitions
- Added titles for levels
- "Congrats" and "return to menu" messages after victory
- Little menu updates
Don't think I'm making any more changes to the game for a while (unless you submit a high score, in which case I'll put your time/username in the level selection screen)
Version 0.4
Various changes:
- Two songs and mowing sfx by David Carney/DVGMusic (we're long-time collaborators!)
- Two new levels
- Main menu renders thumbnails of level layouts

Wanted to see if I could make a post-processing effect to distort previously-drawn screen pixels.
It works, but it's probably too slow to be practical - the much, much cooler thing here is a serendipitous glitch-art effect that happens when the screen isn't cleared between frames. Hit the Z/O key to toggle that.
The distortion effect works like this: It copies the frame buffer into the sprite sheet, then redraws a portion of the screen, pixel by pixel, by reading the sprite sheet - but it modifies the sprite lookup position for each pget() call, so you get the spherical bump when it's done.
Can anybody give me some optimization tips? I feel like there's some kinda trickery out there to make it more powerful (the demo here uses radius=26, but if I put it above 28, it drops to half-fps, at least on my laptop). If you've dealt with lots (thousands) of individual pixel draws per frame, let me know what you learned!
I tried using peek() and poke(), but it seemed like it ended up being slower than pset() for drawing pixels one-at-a-time, since the image data is packed with two pixels per byte - so they had to be separated and joined a bunch of times. Maybe there's some super-lean way to do that, which I didn't think of?

Version 2.0
Made some changes to make this thing a bit cooler:
-
Overhauled the cloth sim so it operates in 3D now. It's projected orthographically ("just uh, ignore the z value for rendering," in this case), so there's no parallax - but even so, allowing points to move on the z-axis produces much more believable motion. I'm leaving the old version up for comparison. Particularly, the mostly-intact flags don't hold themselves upright like a rectangle made of jello anymore.
-
Added basic "quad rendering." It draws two extra pixel-lines to connect pairs of simulation-lines. Makes it seem like the simulation is much higher-density than it actually is - score! (The cloth sim uses 7 rows with 10 particles each). For style, some of the simulation lines are now invisible (like the horizontal lines along unbroken stripe segments, and all the non-star diagonal structure lines)
- Added an extra prize when you win. It doesn't tell you in-game, but you can mash the "cancel" button on the victory screen to stress test it. Be careful not to hit the OK button, since that still acts as the reset button, like usual.
[b]Version 1.0






1 comment
