okay so i just began using the particle system and i had trouble with pausing i finally found out how to pause it but now i can,t make it start again so here is what i've done by now and this is just a practice i'm doing to eventually add it to my game
local fireparticlesystem = love.graphics.newImage("fire for particle system.png")
local ps = love.graphics.newParticleSystem(fireparticlesystem, 25)
empty = ps:isEmpty()
ps:setEmissionRate(5)
ps:setParticleLife(5)
ps:setSizes(1)
ps:setLifetime(-1)
function love.load()
end
function love.draw()
love.graphics.draw(ps, 380, 280, 0, 1, 1, 0, 0)
end
function love.update(dt)
ps:update(dt)
if ps:isActive() then
if love.timer.getTime() >= 5 then
ps:pause()
if ps:pause() then
if love.timer.getTime() >= 1 then
ps:start()
end
end
end
end
end
now i was just wondering i think the problem is in the timers maybe they all run as one so it doesn't work would that be possible? and thanks for the file but it's not helping although i think i understand a bit more the particle system. and if the problem is the timers how could i fix this because i never really used the timers
actually i made some more test and it seems that whenever I add timers, I can't start it back again it just ignores it
Yup, this is exactly what you should do. I've been toying with the particle system recently, here's a file you can test it out with (any keypress will toggle update).
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
that might worked but the problem is i want no particle when it is paused although the sample you gave me only made them stop moving but hanks for trying tho
Nixola, i tried the ps:stop() but then when i tried to ps:start() it didn't work
and i will try the same thing as the update but with the draw thanks I didn't thought about this
Fatmat927 wrote:Nixola, i tried the ps:stop() but then when i tried to ps:start() it didn't work
and i will try the same thing as the update but with the draw thanks I didn't thought about this
Just look a my example above.
It uses start & stop without any problems.
Nixola's approach works just as well.
The difference is 'stop' will stop particles from being generated. The particles already created will disappear.
Preventing 'update' from occurring (Nixola's approach) will just stop the generation of new particles and retain all the previously generated particles in their current positions.
Your problem should be solved!