Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function spawn(s)
- Spawn.configure(s,"etincelle.png", 4);
- for i = 0, 100 do
- Spawn.createParticle(s,0,0,40*i,0,3,true)
- end
- Spawn.start(s,0.01)
- end
- function trajectoire(particle)
- lifeTime, age, frameTime = Particle.getAge(particle);
- if age >= lifeTime/2 then
- transparence = 255 * 2 * age / lifeTime
- if transparence > 510 then
- transparence = 510
- end
- Particle.setColor(particle,255,255- transparence,255 - transparence, 255 - transparence)
- end
- angle = Particle.getAngle(particle);
- speed = Particle.getSpeed(particle);
- Particle.turn(particle, 10);
- x = Particle.getX(particle);
- y = Particle.getY(particle);
- Particle.setPosition(particle, x + math.cos(angle*math.pi/180)*speed, y + math.sin(angle*math.pi/180)*speed);
- end
- enregistrerParticule("nuage", trajectoire, spawn)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement