Log In  

Cart #10440 | 2015-05-03 | Code ▽ | Embed ▽ | No License

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. :)
P#10441 2015-05-03 16:35 ( Edited 2016-06-21 14:55)

This looks super amazing :) Nice work

P#10444 2015-05-03 17:55 ( Edited 2015-05-03 21:55)
:: jph

Thanks for this, I am learning Lua so nice code is useful to see.
These effects look great!

P#10454 2015-05-04 08:41 ( Edited 2015-05-04 12:41)
:: viza

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! :)

P#10469 2015-05-04 19:14 ( Edited 2015-05-04 23:14)

Wow! Thanks!

P#10473 2015-05-04 21:54 ( Edited 2015-05-05 01:54)
:: allan

this is killer

P#10673 2015-05-15 02:43 ( Edited 2015-05-15 06:43)

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!

P#14307 2015-09-18 06:19 ( Edited 2015-09-18 10:19)

Click the image left to the cartridge title above. Download that PNG and "LOAD FILENAMEHERE" in pico. Press ESC to see source code.

P#14308 2015-09-18 06:46 ( Edited 2015-09-18 10:46)
:: gizmo


  • 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)


P#14309 2015-09-18 06:49 ( Edited 2015-09-18 10:49)

Super perfect, thank you :)

P#14310 2015-09-18 07:00 ( Edited 2015-09-18 11:00)
:: matt

this is great! nice work.

P#14311 2015-09-18 07:07 ( Edited 2015-09-18 11:07)

It does look brilliant. I might use this in a game one day!

As long as the game is smaller than 4000 tokens.

P#14313 2015-09-18 09:32 ( Edited 2015-09-18 13:32)

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.

P#14315 2015-09-18 09:36 ( Edited 2015-09-18 13:36)
:: Ivoah

Looks cool! I got a memory error after holding down x for a few seconds in the star field one :P

P#14328 2015-09-18 17:37 ( Edited 2015-09-18 21:37)
:: Reload

Seems broken at the moment :-(

P#15033 2015-10-06 08:24 ( Edited 2015-10-06 12:24)
:: Pizza

What Reload said. A number of games seem to be having issues right now.

P#15056 2015-10-06 15:45 ( Edited 2015-10-06 19:45)

runtime error in the web player (haven't tried in standalone yet...)

P#15078 2015-10-07 06:04 ( Edited 2015-10-07 10:04)

changed line 580 from

    local e = psystem.emitters[flr(rnd(count(psystem.emiters)))+1]


    local e = psystem.emitters[flr(rnd(#(psystem.emitters)))+1]
P#15185 2015-10-09 11:42 ( Edited 2015-10-09 15:42)

Hey thanks for fixing it. :)

This is pretty awesome. My favorite is the blood effect.

P#15204 2015-10-09 17:56 ( Edited 2015-10-09 21:56)
:: booyaa

those particle effects are awesome!

P#16952 2015-11-24 03:27 ( Edited 2015-11-24 08:27)


EDIT: oh thx

P#16997 2015-11-24 16:39 ( Edited 2015-11-24 21:39)

this seems to be broken again...
Also the particle effect demo in Zine 1 doesn't work either

P#19831 2016-04-17 13:53 ( Edited 2016-04-17 17:53)

Yeah, I've tried this with the fix for line 580 and unfortunately, it didn't run. Boo.

P#21318 2016-05-25 07:23 ( Edited 2016-05-25 11:23)

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.


P#21328 2016-05-25 09:30 ( Edited 2016-05-25 13:30)

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 :)

P#23356 2016-06-21 04:20 ( Edited 2016-06-21 08:20)

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.

P#23358 2016-06-21 09:57 ( Edited 2016-06-21 13:57)

This looks good and useful!

P#23361 2016-06-21 10:55 ( Edited 2016-06-21 14:55)

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2020-10-31 22:34 | 0.032s | 4194k | Q:84