This commit is contained in:
Martijn de Boer 2022-10-15 23:31:47 +02:00
parent b7d3bcce27
commit 33cb763493
No known key found for this signature in database
GPG key ID: 9D2E42402DD372D1
4 changed files with 14 additions and 2 deletions

View file

@ -12,7 +12,8 @@ multilily = lily.loadMulti({
{lily.newImage, "assets/particle.png"},
{lily.newImage, "assets/tiles/gf.png"},
{lily.newImage, "assets/explosion.png"},
{lily.newImage, "assets/weapons/bullet.png"}
{lily.newImage, "assets/weapons/bullet.png"},
{lily.newImage, "assets/gameover.png"},
})
multilily:onComplete(function(_, lilies)
gameLogo = lilies[1][1]
@ -29,6 +30,7 @@ multilily:onComplete(function(_, lilies)
tileGroundFull = lilies[12][1]
explosionParticle = lilies[13][1]
bulletShot = lilies[14][1]
gameoverLogo = lilies[15][1]
windowWidth = love.graphics.getWidth()
windowHeight = love.graphics.getHeight()

BIN
assets/gameover.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

BIN
assets/gameover.psd Normal file

Binary file not shown.

View file

@ -120,9 +120,13 @@ function GameScene:draw()
GameScene.bullets[y]:draw()
end
end
else
love.graphics.draw(eSystem, currentPlayer.px, currentPlayer.py)
local logoWidth = gameoverLogo:getWidth()
local logoHeight = gameoverLogo:getHeight()
love.graphics.setColor(1,1,1,GameScene.logoScale.a)
love.graphics.draw(gameoverLogo, (windowWidth - logoWidth) / 2, (windowHeight-logoHeight) / 2, 0, GameScene.logoScale.x, GameScene.logoScale.y )
end
end
@ -300,9 +304,15 @@ function GameScene:checkCollisions()
if cp == 0 then
currentPlayer.death = true
self:generateExplosion( currentPlayer.px, currentPlayer.py )
self:generateLogoEffect()
end
end
function GameScene:generateLogoEffect()
GameScene.logoScale = {x= 0.6, y= 0.6, a= 0}
flux.to(GameScene.logoScale, 0.5, {x= 1, y= 1, a= 1}):ease("quintout"):delay(0.5)
end
function GameScene:generateExplosion(px,py)
GameScene:generateExplosionSound(px,py)
GameScene.explosionObj = {angle=100, radius=100}