Help with particle system
Posted: Tue Feb 11, 2014 2:29 am
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
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