Log In  


Cart #particletest-0 | 2023-08-21 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
23

Particle Effects

Sixteen different kind of particles based on same generation method. I get the idea of the main function and loop of the particles from Youtube video of "Particles in Pico-8 - The Ultimate Guide" from SpaceCat.

All functions work and genrate particle when "O" button is passed. The particles can be implemented to other carts by only copying the function into the code. So, everyone is free to use the particless as long as they refer to my work :D

23


4

This is so satisfying to play with! I really like the range of effects you've explored. Nice work on this!

I have a small suggestion for 2 of the effects, if you're open to that.

In Vacuum, if you didn't want the particles to collect along the X & Y axes, you could move them directly towards the center instead of moving X & Y separately.


change this:

if p.x<64 then p.x+=p.dx*2 end
if p.x>64 then p.x-=p.dx*2 end
if p.y<64 then p.y+=p.dy*2 end
if p.y>64 then p.y-=p.dy*2 end

to this:

--calulate direction to center
local dx,dy=64-p.x,64-p.y
--normalize (change length to 1)
local length=sqrt(dx*dx+dy*dy)
dx/=length
dy/=length
--move particle
p.x+=dx*p.dx
p.y+=dy*p.dy

In Fireworks, if you wanted round explosions instead of square, you could calculate dx & dy by starting with a random speed & angle.


change this:

add(frw,{x=64,y=48,
 rad=0,dx=rnd(2)-1,dy=rnd(2)-1,
 act=50,clr=10,grv=0.02})

to this:

local angle,speed=rnd(1),rnd(2)-1
local dx=speed*cos(angle)
local dy=speed*sin(angle)
add(frw,{x=64,y=48,
 rad=0,dx=dx,dy=dy,
 act=50,clr=10,grv=0.02})


1

@zovirl thanks for playing!

And also thanks for the feedbacks. For Vacuum i was trying to solve that problem and you gave a great simple solution.

For fireworks the round explosions are so much better :)


2

It looks good, I just started working with it and it amazes me how much stuff can be done on this platform.


1

@ijetanar yes, every cart has something in it for people to imagine new things!


This is soo cool! Better than anything I could make!

I used it in my project and realized you had the CC BY-NC-SA 4.0 License, can I use the Flame, Snow, And Smoke particles? If I post it i'll give you credit in the description.

I'm not very sure how copyright/copyleft stuff works, but if I post it, i'd like to use the Apache 2.0 License.

I'd just like the go ahead from the creator.


I hope you still use PICO-8 and see this, it looks like you haven't posted since 2023.



[Please log in to post a comment]