Constructor
new Timer(game, delay, callback, timesToRepeat)
Handler for timed events.
Parameters:
Name | Type | Description |
---|---|---|
game |
Carrot.Game | The core game object. |
delay |
delay | The amount of time when the timer shall fire. |
callback |
function | The method to be called when the timer fires. |
timesToRepeat |
integer | Times the timer shall be repeat. 0 is a one time event. |
Methods
destroy()
Destroys the timer and removes it from @Carrot.Time.
pause()
Resumes the timer.
pause()
Pauses the timer.
start()
Starts the timer