Thanks.
Check this out. Works really well and gives you a sort of a Firework effect
--Ring Explosion Particle
-- DEFINE PARTICLE TYPE PROPERTIES
local ring = {}
ring.imagePath = "picture.png"
ring.imageWidth = 22 -- PARTICLE IMAGE WIDTH (newImageRect)
ring.imageHeight = 14 -- PARTICLE IMAGE HEIGHT (newImageRect)
ring.velocityStart = 500 -- PIXELS PER SECOND
ring.velocityVariation = 100
ring.velocityChange = -5
ring.rotationStart = 0
ring.rotationVariation = 200
ring.directionVariation = 360
ring.alphaStart = 1 -- PARTICLE START ALPHA
ring.fadeInSpeed = 0.5 -- PER SECOND
ring.fadeOutSpeed = -2.0 -- PER SECOND
ring.fadeOutDelay = 500 -- WHEN TO START FADE-OUT
ring.scaleStart = .5 -- PARTICLE START SIZE
ring.scaleVariation = .5
ring.scaleInSpeed = 0
ring.weight = 0-- PARTICLE WEIGHT (\>0 FALLS DOWN, \<0 WILL RISE UPWARDS)
ring.emissionShape = 0 -- 0 = POINT, 1 = LINE, 2 = RING, 3 = DISC
ring.emissionRadius = 5 -- SIZE / RADIUS OF EMISSION SHAPE
ring.killOutsideScreen = true -- PARENT LAYER MUST NOT BE NESTED OR ROTATED!
ring.lifeTime = 2000 -- MAX. LIFETIME OF A PARTICLE
ring.useEmitterRotation = false --INHERIT EMITTER'S CURRENT ROTATION
ring.blendMode = "normal" -- SETS BLEND MODE ("add" OR "normal", DEFAULT IS "normal")
Particles.CreateParticleType ("Ring", ring)
Particles.CreateEmitter("E3", screenW/2, 160, 0, false, true)
Particles.AttachParticleType("E3", "Ring" , 500, 99999,0)
--Blow Effect
local function blow()
Particles.StartEmitter("E3")
local function stop ()
Particles.StopEmitter("E3")
end
timer.performWithDelay(100,stop,1)
end
timer.performWithDelay(1000,blow,0)
You need this timer at the end so that you stop the emitter. Maybe there is another way to do it. This one keeps looping. Just change the 0 to 1 to play it once, in the timer. [import]uid: 8192 topic_id: 10408 reply_id: 38457[/import]