[LIBRARY] EZTimer, an easy to use timer
Posted: Fri Mar 20, 2015 4:07 pm
EZTimer is a very simple, short timing library in only 17 lines!
Remember you need to require this library!
To make a new timer place this in the love.load() section,
and put the desired amount of time (in seconds) between the parentheses like this,
To check if the timer has completed or not, place this somewhere in the love.update(),
And finally all ways REMEMBER to place,
in the love.update().
And that's pretty much it!
Heres an example
Note: This is my first commercial library so, cut me some slack!
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