From f520dbb3885d69a8ee7aa72cac0d91860bd992d6 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Thu, 16 Sep 2021 22:31:46 +0200 Subject: [PATCH] chore: remove unused old gameover --- .../battlesystem/gui/screens/gameover.lua | 91 ------------------- 1 file changed, 91 deletions(-) delete mode 100644 sonic-radiance.love/scenes/battlesystem/gui/screens/gameover.lua diff --git a/sonic-radiance.love/scenes/battlesystem/gui/screens/gameover.lua b/sonic-radiance.love/scenes/battlesystem/gui/screens/gameover.lua deleted file mode 100644 index 322841d..0000000 --- a/sonic-radiance.love/scenes/battlesystem/gui/screens/gameover.lua +++ /dev/null @@ -1,91 +0,0 @@ -local GameOverScreen = Object:extend() - -local TweenManager = require "birb.classes.time" -local ConfirmDialog = require "game.modules.confirmdialog" - -local defTransitions = require "birb.modules.transitions" -local radTransitions = require "game.modules.transitions" - -local gui = require "game.modules.gui" - -local tw, th = 128, 32 - -function GameOverScreen:new(scene) - self.scene = scene - self.assets = scene.assets - self.turnSystem = scene.turns - - self:setVariables() - - self.continueBox = gui.newTextBox("assets/gui/dialogbox.png", tw, th) - - self.tweens = TweenManager(self) - self:prepareAnimation() -end - -function GameOverScreen:setVariables() - -- Vignette Opacity - self.vignetteOpacity = 0 - - -- Battle FInished Label - self.labelOpacity = 0 - local width, height = core.screen:getDimensions() - self.labelX = width/2 - - -- Infobox - self.tbSize = 0.6 - self.tbOpacity = 0 -end - -function GameOverScreen:prepareAnimation() - -- Vignette - self.tweens:newTween(0, 0.6, {vignetteOpacity=0.75}, 'inExpo') - - -- Label - self.tweens:newTween(0, 0.6, {labelOpacity=1}, 'inExpo') - self.tweens:newTween(0.9, 0.4, {labelX=4}, 'inExpo') - - self.tweens:newTimer(1.8, "continue") -end - -function GameOverScreen:update(dt) - self.tweens:update(dt) -end - -function GameOverScreen:draw() - local width, height = core.screen:getDimensions() - self:drawVignette(width, height) - self:drawLabel(width/2, 48, self.labelX, self.labelOpacity) -end - -function GameOverScreen:timerResponse(timer) - if (timer == "continue") then - local confirm = ConfirmDialog(self.scene, "Do you want to return to title ? \nYou can also reload your latest save.", - function() self:returnToTitle() end, "Return to title", - function() self:loadLastSave() end, "Reload last save") - confirm.darken = false - end -end - -function GameOverScreen:drawVignette(width, height) - love.graphics.setColor(0, 0, 0, self.vignetteOpacity) - love.graphics.rectangle("fill", 0, 0, width, height) -end - -function GameOverScreen:drawLabel(x, y, x2, opacity) - love.graphics.setColor(1, 1, 1, opacity) - - self.assets.fonts["SA2font"]:print("GAME", x - x2, y, "right") - self.assets.fonts["SA2font"]:print("OVER", x + x2, y, "left") -end - -function GameOverScreen:returnToTitle() - core.screen:startTransition(defTransitions.default, defTransitions.circle, function() scenes.menus.title(true) end, 424/2, 240/2) -end - -function GameOverScreen:loadLastSave() - self.scene.tweens:newTween(0, 0.3, {borderPosition=0}, "inOutQuad") - core.screen:startTransition(defTransitions.default, defTransitions.default, function() game:reload() scenes.overworld() end, 424/2, 240/2) -end - -return GameOverScreen