summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-09-03 20:01:34 +0200
committerAki <nthirtyone@gmail.com>2017-09-03 20:01:34 +0200
commitecf44e285df0dc5bfae26db50b274cf49ce46576 (patch)
tree2eacc7ddab6266eb0e8f158b46457512d080e0c2
parent20d03d8917ba38568fc56dc53576efb22c1d459c (diff)
downloadroflnauts-ecf44e285df0dc5bfae26db50b274cf49ce46576.zip
roflnauts-ecf44e285df0dc5bfae26db50b274cf49ce46576.tar.gz
roflnauts-ecf44e285df0dc5bfae26db50b274cf49ce46576.tar.bz2
Default delay static for Selector
-rw-r--r--not/Selector.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/not/Selector.lua b/not/Selector.lua
index 5e54f6e..11e88d3 100644
--- a/not/Selector.lua
+++ b/not/Selector.lua
@@ -14,6 +14,8 @@ selector:new(menu)
]]
Selector = require "not.Element":extends()
+Selector.DEFAULT_DELAY = 2
+
function Selector:new (parent)
Selector.__super.new(self, parent)
self.sprite, self.quads = parent:getSheet()
@@ -22,7 +24,7 @@ function Selector:new (parent)
self.margin = 0
self.focused = false
self.global = false
- self.delay = 2
+ self.delay = Selector.DEFAULT_DELAY
self.first = false
self.shape = "portrait"
end
@@ -234,8 +236,8 @@ function Selector:draw (scale)
end
function Selector:update (dt)
self.delay = self.delay + dt
- if self.delay > Selector.delay then -- Selector.delay is initial
- self.delay = self.delay - Selector.delay
+ if self.delay > Selector.DEFAULT_DELAY then
+ self.delay = self.delay - Selector.DEFAULT_DELAY
end
end