Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. function spawn(s)
  2.     Spawn.configure(s,"etincelle.png", 4);
  3.     for i = 0, 100 do
  4.         Spawn.createParticle(s,0,0,40*i,0,3,true)
  5.     end
  6.     Spawn.start(s,0.01)
  7. end
  8.  
  9.  
  10. function trajectoire(particle)
  11.  
  12.     lifeTime, age, frameTime = Particle.getAge(particle);
  13.     if age >= lifeTime/2 then
  14.         transparence = 255 * 2 * age / lifeTime
  15.         if transparence > 510 then
  16.             transparence = 510
  17.         end
  18.         Particle.setColor(particle,255,255- transparence,255 - transparence, 255 - transparence)
  19.     end
  20.     angle = Particle.getAngle(particle);
  21.     speed = Particle.getSpeed(particle);
  22.     Particle.turn(particle, 10);
  23.     x = Particle.getX(particle);
  24.     y = Particle.getY(particle);
  25.     Particle.setPosition(particle, x + math.cos(angle*math.pi/180)*speed, y + math.sin(angle*math.pi/180)*speed);
  26. end
  27.  
  28. enregistrerParticule("nuage", trajectoire, spawn)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement