Code: Select all
flux = require "assets/flux"
function love.load()
love.graphics.setBackgroundColor(0, 0, 0)
fade = {alpha = 0}
image01 = love.graphics.newImage("assets/hohoho.png")
image02 = love.graphics.newImage("assets/kyaaaa.png")
-- the flux library used to make tweening animation (fade from black, fade to black)
flux.to(fade, 1.5, {alpha = 255}):ease("linear"):delay(2)
:after(fade, 1.5, {alpha = 0}):ease("linear"):delay(1.5)
end
function love.update(dt)
flux.update(dt)
love.mouse.setVisible(false)
if love.keyboard.isDown("escape") then
love.event.quit()
end
end
function love.draw()
love.graphics.setColor(255, 255, 255, fade.alpha)
love.graphics.draw(image01, 0, 0)
end