diff --git a/Win/DrawWin.lua b/Win/DrawWin.lua new file mode 100644 index 0000000..6d4719c --- /dev/null +++ b/Win/DrawWin.lua @@ -0,0 +1,34 @@ +local function winner() + local width = love.graphics.getWidth() + local height = love.graphics.getHeight() + local opacity = 0.3 + local s = "" + + if _G.P1_WIN then + s = "P1 Win! R - Restart" + end + if _G.P2_WIN then + s = "P2 Win! R - Restart" + end + + if _G.P1_WIN or _G.P2_WIN then + -- Overlay + DrawGame() --Draw a single frame of the game + love.graphics.setColor(0.1, 0.1, 0.1, opacity) --overlay opaque img + love.graphics.rectangle("fill", 0, 0, width, height) + + -- Who won text + local sw, sh = MenuFont:getWidth(s), GameFont:getHeight(s) + local centreX = width / 2 + local centreY = height / 2 + + love.graphics.setFont(MenuFont) + love.graphics.setColor(1, 1, 1) -- white + love.graphics.print(s, centreX - sw / 2, centreY - sh / 2) + end +end + +function DrawWin() + winner() + love.graphics.setColor(255, 255, 255) -- reset colours +end diff --git a/Win/UpdateWin.lua b/Win/UpdateWin.lua new file mode 100644 index 0000000..4c713ab --- /dev/null +++ b/Win/UpdateWin.lua @@ -0,0 +1 @@ +function UpdateWin(dt) end