local spaceshiphud={}
local hudImage
local scale=1.5
local scaleDuration=7
local scaleElapsed=0
function spaceshiphud.load()
hudImage=love.graphics.newImage("spaceship-hud.png")
end
function spaceshiphud.update(dt,timePassed)
if scaleElapsed<scaleDuration then
scaleElapsed=scaleElapsed+dt
if scaleElapsed>scaleDuration then
scaleElapsed=scaleDuration
end
local t=scaleElapsed/scaleDuration
local ease=1-(1-t)*(1-t)
scale=1.5-0.5*ease
end end
function spaceshiphud.draw()
local canvasWidth=1920
local canvasHeight=1080
local imageWidth=hudImage:getWidth()*scale
local imageHeight=hudImage:getHeight()*scale
local x=(canvasWidth-imageWidth)/2
local y=(canvasHeight-imageHeight)/2
love.graphics.draw(hudImage,x,y,0,scale,scale)
end
return spaceshiphud
