invaders: use timer
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
92ad2f645f
commit
1c8be5b620
|
@ -23,6 +23,7 @@
|
||||||
--}}}
|
--}}}
|
||||||
|
|
||||||
local wibox = wibox
|
local wibox = wibox
|
||||||
|
local timer = timer
|
||||||
local widget = widget
|
local widget = widget
|
||||||
local awful = require("awful")
|
local awful = require("awful")
|
||||||
local beautiful = require("beautiful")
|
local beautiful = require("beautiful")
|
||||||
|
@ -552,6 +553,13 @@ function run(args)
|
||||||
gamedata.running = true
|
gamedata.running = true
|
||||||
end
|
end
|
||||||
|
|
||||||
awful.hooks.timer.register(0.02, shots.handle)
|
-- Start timers
|
||||||
awful.hooks.timer.register(0.03, shots.handle_enemy)
|
local t = timer { timeout = 0.02 }
|
||||||
awful.hooks.timer.register(0.01, enemies.handle)
|
t:add_signal("timeout", shots.handle)
|
||||||
|
t:start()
|
||||||
|
local t = timer { timeout = 0.03 }
|
||||||
|
t:add_signal("timeout", shots.handle_enemy)
|
||||||
|
t:start()
|
||||||
|
local t = timer { timeout = 0.01 }
|
||||||
|
t:add_signal("timeout", enemies.handle)
|
||||||
|
t:start()
|
||||||
|
|
Loading…
Reference in New Issue