Skip to content

Instantly share code, notes, and snippets.

@GloryFish
Created December 30, 2010 04:37
Show Gist options
  • Save GloryFish/759464 to your computer and use it in GitHub Desktop.
Save GloryFish/759464 to your computer and use it in GitHub Desktop.
Minimal example of particles in love
function love.load()
local particleImage = love.graphics.newImage('particle.jpg')
particles = love.graphics.newParticleSystem(particleImage, 300)
particles:setPosition(love.graphics.getWidth() / 2, love.graphics.getHeight() / 2)
particles:setSpeed(10, 50)
particles:setColor(255, 255, 255, 255, 255, 255, 255, 0)
particles:setParticleLife(1, 3)
particles:start()
end
function love.update(dt)
particles:update(dt)
end
function love.draw()
love.graphics.draw(particles)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment