summaryrefslogtreecommitdiffhomepage
path: root/world.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-06-21 16:20:06 +0200
committerAki <nthirtyone@gmail.com>2016-06-21 16:20:06 +0200
commitc825b4b1f8e4ee3800a63bb1011f43aaa3c32aab (patch)
tree979de5549cc7955b963b1e8b3ed91b51f335fbd5 /world.lua
parent6e933c14d25e1fa0c3636ef0e1e9243df3a90291 (diff)
downloadroflnauts-c825b4b1f8e4ee3800a63bb1011f43aaa3c32aab.zip
roflnauts-c825b4b1f8e4ee3800a63bb1011f43aaa3c32aab.tar.gz
roflnauts-c825b4b1f8e4ee3800a63bb1011f43aaa3c32aab.tar.bz2
Big texts
Diffstat (limited to 'world.lua')
-rw-r--r--world.lua13
1 files changed, 11 insertions, 2 deletions
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