summaryrefslogtreecommitdiffhomepage
path: root/button.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-08-22 18:17:08 +0200
committerAki <nthirtyone@gmail.com>2016-08-22 18:17:08 +0200
commit4bcaf1770c0aa693e24359ee52f7552f301917d3 (patch)
tree56bad8ede42aea0332c32edc41bd3c35209b728a /button.lua
parent402e19b8bf19fb24af0fdc5b77f44088f48814ed (diff)
downloadroflnauts-4bcaf1770c0aa693e24359ee52f7552f301917d3.zip
roflnauts-4bcaf1770c0aa693e24359ee52f7552f301917d3.tar.gz
roflnauts-4bcaf1770c0aa693e24359ee52f7552f301917d3.tar.bz2
Faster
Diffstat (limited to 'button.lua')
-rw-r--r--button.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/button.lua b/button.lua
index 7262813..f221cda 100644
--- a/button.lua
+++ b/button.lua
@@ -56,7 +56,10 @@ function Button:draw(scale)
love.graphics.printf(string.upper(self.text), (x+2)*scale, (y+4)*scale, 54, "center", 0, scale, scale)
end
function Button:update(dt)
- self.delay = (self.delay + dt)%Button.delay -- Button.delay is initial
+ self.delay = self.delay + dt
+ if self.delay < Button.delay then -- Button.delay is initial
+ self.delay = self.delay - Button.delay
+ end
end
function Button:controlpressed(set, action, key)
if action == "attack" and self.focused then