Class: Timer

Carrot.Timer(game, delay, callback, timesToRepeat)

Carrot.Timer

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.
Source:

Methods

destroy()

Destroys the timer and removes it from @Carrot.Time.
Source:

pause()

Resumes the timer.
Source:

pause()

Pauses the timer.
Source:

start()

Starts the timer
Source: