Remember you need to require this library!
Code: Select all
require('timer')
Code: Select all
timer_new()
Code: Select all
timer_new(5)
Code: Select all
timer_isTime(function(object)
-- If timer is done, run this code.
end)
Code: Select all
timer_update(dt)
And that's pretty much it!
Heres an example
Code: Select all
require('timer')
function love.load()
timer_new(10)
end
function love.update(dt)
timer_update(dt)
timer_isTime(function(object)
print('TIMER FINISHED')
end)
end