summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--menu.lua5
-rw-r--r--world.lua13
2 files changed, 16 insertions, 2 deletions
diff --git a/menu.lua b/menu.lua
index 9340881..5b0ade1 100644
--- a/menu.lua
+++ b/menu.lua
@@ -62,11 +62,16 @@ function Menu:draw()
end
local countdown, _ = math.modf(self.countdown)
local w, h = love.graphics.getWidth()/self.scale, love.graphics.getHeight()/self.scale
+ local scale = self.scale
if self.countdown < 6 then
love.graphics.setFont(Bold)
love.graphics.print(countdown,(w/2-6.5)*self.scale,(h/2+30)*self.scale,0,self.scale,self.scale)
love.graphics.setFont(Font)
end
+ -- header
+ love.graphics.setFont(Bold)
+ love.graphics.printf("ROFLNAUTS2",(w/2)*scale,(30)*scale,336,"center",0,scale/2,scale/2,168,12)
+ love.graphics.setFont(Font)
end
function Menu:update(dt)
diff --git a/world.lua b/world.lua
index fd23287..3b645e5 100644
--- a/world.lua
+++ b/world.lua
@@ -26,7 +26,10 @@ World = {
-- Map
map = nil,
-- Gameplay status
- lastNaut = false
+ lastNaut = false,
+ -- "WINNER"
+ win_angle = 0,
+ win_dir = 1
}
-- Constructor of `World` ZA WARUDO!
@@ -232,6 +235,12 @@ function World:update(dt)
table.remove(self.Effects, _)
end
end
+ -- Bounce `winner`
+ if self.lastNaut then
+ if self.win_angle > 5 then self.win_dir = -1
+ elseif self.win_angle < -5 then self.win_dir = 1 end
+ self.win_angle = self.win_angle + dt * self.win_dir * 16
+ end
end
-- Draw
@@ -312,7 +321,7 @@ function World:draw()
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,"center",0,scale,scale)
+ love.graphics.printf("WINNER",(w/2)*scale,(40)*scale,336,"center",self.win_angle*math.pi/180,scale,scale,168,12)
love.graphics.setFont(Font)
end
end