The Timer class allows the use of timers
in your game.
Properties
- cycleCnt
- seconds
- lastTime
- client
Methods
-
heapPtr new() |
If Timer:new() is called, it creates
a timer instance and returns a pointer to it. Otherwise, it
simply returns a pointer to the instance calling it.
|
-
void init(heapPtr
theClient) |
Sets up the timer object setting
it's client property to theClient.
|
-
void doit() |
Performs the timer's actions.
If the cycleCnt property is not
-1, it decrements it. If it is equal to zero, the client is
cued. Otherwise, it retreives the time, and if it is not equal
to the last time, and seconds equals zero, it cues the client.
|
-
void dispose() |
Frees the timer from it's client.
|
-
void set(heapPtr
theClient, number sec[, number min, number hour]) |
Assigns the timers client and
time.
|
-
void setCycle(heapPtr
theClient, number cycleCounter) |
Sets up the event's client and
cycleCnt.
|
-
void setReal(heapPtr
theClient, number milliSec[, number sec, number min]) |
Assigns the timers client and
time. This is basicly the same as set(), but can be more precise.
milliSec is between 0 and 59 for the amount of interpreter "ticks".
|
-
void delete() |
If it's client is NULL, it deletes
the timer.
|
|