diff --git a/assets.lua b/assets.lua index 273bc1e..23518bb 100644 --- a/assets.lua +++ b/assets.lua @@ -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() diff --git a/assets/gameover.png b/assets/gameover.png new file mode 100644 index 0000000..fd39dcf Binary files /dev/null and b/assets/gameover.png differ diff --git a/assets/gameover.psd b/assets/gameover.psd new file mode 100644 index 0000000..85cd956 Binary files /dev/null and b/assets/gameover.psd differ diff --git a/scene/game.lua b/scene/game.lua index d410e2b..e6a61dd 100644 --- a/scene/game.lua +++ b/scene/game.lua @@ -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}