I'm looking for a very simple particle system that I can play around with so I can learn it. I've tried making one myself I've found on another forum but it doesn't work. When I use the following code I get an error - attempt to call method 'setParticleLife' (a nil value)
When I take that line out, nothing seems to happen at all. What am I doing wrong?
local image, particlesystem
function love.load()
image = love.graphics.newImage("Electisock.png")
particlesystem = love.graphics.newParticleSystem(image,8)
particlesystem:setEmissionRate(3)
particlesystem:setParticleLife(5)
particlesystem:setSizes(1.0, 0.8, 0.4, 0.1)
particlesystem:start()
end
function love.update(dt)
particlesystem:update(dt)
end
function love.draw()
love.graphics.draw(particlesystem,100,100)
end
Help with particle system
- ejmr
- Party member
- Posts: 302
- Joined: Fri Jun 01, 2012 7:45 am
- Location: South Carolina, U.S.A.
- Contact:
Re: Help with particle system
The method name is setParticleLifetime().
Re: Help with particle system
Maybe this can help you?
http://love2d.org/forums/viewtopic.php? ... le#p161206
It lets you make particles with an editor and then generates the neccesary code so you can see how they work.
http://love2d.org/forums/viewtopic.php? ... le#p161206
It lets you make particles with an editor and then generates the neccesary code so you can see how they work.
-
- Prole
- Posts: 2
- Joined: Tue Feb 11, 2014 2:23 am
Re: Help with particle system
Awesome, thanks guys
Who is online
Users browsing this forum: Bing [Bot], Semrush [Bot] and 5 guests