Created
December 30, 2010 04:37
-
-
Save GloryFish/759464 to your computer and use it in GitHub Desktop.
Minimal example of particles in love
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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