Change HUMP Time delay
Posted: Tue Jul 26, 2016 8:08 pm
Hello!
What are the best way to change the delay time of a Hump Timer function? I tried to implement a function inside Timer.lua like this:
and in the main game file:
but I get the following error: attempt to call field 'delayTime' (a nil value)
Anyone already managed to do this sort of thing?
Thank you!
What are the best way to change the delay time of a Hump Timer function? I tried to implement a function inside Timer.lua like this:
Code: Select all
function Timer:delayTime(handle, delay)
self.functions[handle] = delay
end
Code: Select all
local time = 1.5
spawn = Timer.every(time, function()
table.insert(obstacle, Obstacle.new(Push:getWidth() * 1.25, love.math.random(0, Push:getHeight()), -500, love.math.random(-5, 5)))
end)
Timer.every(5, function()
time = time - 0.3
Timer.delayTime(spawn, time)
end)
Anyone already managed to do this sort of thing?
Thank you!