summaryrefslogtreecommitdiffhomepage
path: root/not/Timer.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-09-14 17:11:54 +0200
committerAki <nthirtyone@gmail.com>2017-09-14 17:11:54 +0200
commit0e9ad14e9fcee242a68f695715fa106af99aa76f (patch)
tree5b44a8e3b185030c45d1c709edaeef64091358ef /not/Timer.lua
parent31c994c223c0a9a63d503d43877254268f52811c (diff)
downloadroflnauts-0e9ad14e9fcee242a68f695715fa106af99aa76f.zip
roflnauts-0e9ad14e9fcee242a68f695715fa106af99aa76f.tar.gz
roflnauts-0e9ad14e9fcee242a68f695715fa106af99aa76f.tar.bz2
Timer now inherits after Trigger
Diffstat (limited to 'not/Timer.lua')
-rw-r--r--not/Timer.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/not/Timer.lua b/not/Timer.lua
index 3e45b11..6fc4a4c 100644
--- a/not/Timer.lua
+++ b/not/Timer.lua
@@ -1,7 +1,6 @@
-Timer = require "not.Object":extends()
+Timer = require "not.Trigger":extends()
-function Timer:new (trigger, delay)
- self.trigger = trigger
+function Timer:new (delay)
self.delay = delay
self.left = 0
self.active = false
@@ -16,7 +15,7 @@ end
function Timer:update (dt)
if self.active then
if self.left < 0 then
- self.trigger:emit()
+ self:emit()
self.active = false
if self.restart then
self:start()