From ba68d7c8cf8f285c2fad92eac86673054e4c5377 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 20 Jun 2016 22:29:19 +0200 Subject: Winner --- world.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'world.lua') diff --git a/world.lua b/world.lua index cec9f52..8e437a7 100644 --- a/world.lua +++ b/world.lua @@ -163,6 +163,7 @@ function World:createEffect(name, x, y) end -- get Nauts functions +-- more than -1 lives function World:getNautsPlayable() local nauts = {} for _,naut in pairs(self.Nauts) do @@ -173,6 +174,7 @@ function World:getNautsPlayable() return nauts end +-- are alive function World:getNautsAlive() local nauts = {} for _,naut in self.Nauts do @@ -305,6 +307,14 @@ function World:draw() if _ < 3 then y, e = h-33, 0 end naut:drawHUD(1+(_%2)*(w-34), y, scale, e) end + + -- Draw winner + if self.lastNaut then + local w, h = love.graphics.getWidth()/scale, love.graphics.getHeight()/scale + love.graphics.setFont(Bold) + love.graphics.printf("WINNER",(w*0.25)*scale,(20)*scale,(w/2)*scale,"center",0,scale,scale) + love.graphics.setFont(Font) + end end -- beginContact -- cgit v1.1