Sooo... I was doodling around in pico-8, creating a game for #1GAM, and I needed to create some particle systems, so I started to code one, but carried away a bit, and made a general purpose particle system library... and then carried away a bit more, and made a couple of samples for it, and took the liberty to call it "advanced" :) and here is the end result. :)
Feel free to use it in your projects if you want!
A couple of remarks though:
- I don't know a lot about lua optimalizations, but I guess it is not really optimized for speed. :)
- It is quite big in its current form. I guess. This sample cartridge is hovering on the limits of code size, but the library part is way smaller, and more importantly, quite modular. I plan to look into minifying the code, if there are any interest.
- I don't even know if a "library" is viable concept in pico-8... The size limitations are quite severe, so you only want to include what you absolutely must in your code, which usually means hand-coding everything.
- Ohh, and it is quite possible contains bugs. Use at your own risk. :)
- There are documentation or explanation of the workings of any kind for now, but I will write some later. Just look at the code till then. :)
Thanks for this, I am learning Lua so nice code is useful to see.
These effects look great!
Thank you!
I don't know how useful it is for Lua learning purposes (the modularity makes kinda hard to read I guess), but I'm glad if you can use it! :)
Hi! First post and just bought Pico8 :) I think I'm missing something, but... How do I access the source code of this? Thank you!
Click the image left to the cartridge title above. Download that PNG and "LOAD FILENAMEHERE" in pico. Press ESC to see source code.
pistacchio:
- download the cart (right-click on the magenta cart name in the first post and save the .p8.png somewhere, that file is the actual cartridge containing code, gfx, music etc...)
- put it in your pico-8 homefolder
- load it from within pico-8 with load ("load 10440" in this case)
Cheers!
gizmo
It does look brilliant. I might use this in a game one day!
As long as the game is smaller than 4000 tokens.
Well, Connor, you could get rid of things you didn't want.
For example, the only thing I'd probably need is the explosion and the sparks.
Looks cool! I got a memory error after holding down x for a few seconds in the star field one :P
What Reload said. A number of games seem to be having issues right now.
runtime error in the web player (haven't tried in standalone yet...)
changed line 580 from
local e = psystem.emitters[flr(rnd(count(psystem.emiters)))+1] |
to
local e = psystem.emitters[flr(rnd(#(psystem.emitters)))+1] |
Hey thanks for fixing it. :)
This is pretty awesome. My favorite is the blood effect.
this seems to be broken again...
Also the particle effect demo in Zine 1 doesn't work either
Yeah, I've tried this with the fix for line 580 and unfortunately, it didn't run. Boo.
I use the library in my Jam game and it worked great for explosions. The second cart in the thread is the one to download.
the problem is the now obsolete time() function. not sure how to fix it (should be simple, but there's a lot of code to navigate). I would love it if someone was able to fix this wonderful cart :)
Use the last cart you see in the thread, it works. I've used it on a few games thus far and it works great. Only suggestion would be to strip out anything you don't need. As-is, it's pretty fat but you can dig through and see which functions are not needed and remove them.
[Please log in to post a comment]