Code: Select all
function love.load()
local img2 = love.graphics.newImage('brique.png')
psystem = love.graphics.newParticleSystem(img2, 400)
psystem:setParticleLifetime(1, 10) -- Particles live at least 2s and at most 5s.
psystem:setLinearAcceleration(10, 200, 3000, 400) -- Randomized movement towards the bottom of the screen.
psystem:setColors(200, 200, 151, 100, 10, 5, 295, 10) -- Fade to black.
psystem:getDirection(500,47,10,47)
psystem:getSizeVariation(1)
psystem:getAreaSpread(500, 3000)
psystem:getPosition(50,100)
local img1 = love.graphics.newImage('bulle.png')
psystem = love.graphics.newParticleSystem(img1, 40000)
psystem:setParticleLifetime(1, 10) -- Particles live at least 2s and at most 5s.
psystem:setLinearAcceleration(10, 200, 3000, 400) -- Randomized movement towards the bottom of the screen.
psystem:setColors(200, 200, 151, 100, 10, 5, 295, 10) -- Fade to black.
psystem:getDirection(500,47,10,47)
psystem:getSizeVariation(1)
psystem:getAreaSpread(500, 3000)
psystem:getPosition(50,100)
function love.draw()
-- Draw the particle system at the center of the game window.
love.graphics.draw(psystem, love.graphics.getWidth() * 0.5, love.graphics.getHeight() * 0.5)
end
function love.update(dt)
psystem:update(dt)
end
function love.mousepressed(x, y, button, istouch)
if button == 1 then -- Versions prior to 0.10.0 use the MouseConstant 'l'
psystem:emit(125)
printx = x
printy = y
end
end
end