Internal API

GameZero.ContingentScheduledType

A contingent schdule. This type of schedule checks the return value of the action. If the action method returns nothing, no further action is scheduled. Otherwise, the return value is considered to be the interval, in seconds, to the next invocation of the action.

Since action methods are written by end users, the return value of those methods are not considered significant for ease of use. Hence ContingentScheduled is a separate type that should not be end user visible.

GameZero.OnceScheduledType

A scheduled action that is run once. The action is a zero-argument function that is wrapped as a WeakRef object. This ensures that schedules do not inadvertantly store references to game objects. This does however mean that anynymous functions should not be used as scheduled actions.

The time stored in the schedule is in absolute nanoseconds since epoch (Note the epoch for nanoseconds can be arbitrary). User facing times should always be in seconds, or fractions of a second, and usually specifed as interval from current time. Hence the time should be converted before being stored in a Sheduled object.

GameZero.RepeatScheduledType

A scheduled action that is repeated indefinitely. The time of next invocation is stored as time, while the interval between each invocation is stored in interval. Both of these are stored in units of nanoseconds.

GameZero.SchedulerType

The schedule type stores an array of Sheduled objects, and a WallTimer object that is used to keep time. The scheduler object keeps its own timer, and does not reuse the timer in the game main loop, since the game timer can be reset every frame, while the scheduler timer needs to keep absolute time.

Base.angleMethod

Angle to the horizontal, of the line between two actors, in degrees

Base.angleMethod

Angle to the horizontal, of the line between an actor and a point in space, in degrees

GameZero.elapsedMethod

Return nanoseconds since timer was started or 0 if not yet started.

GameZero.tickFunction

Run a contingent schduled action if due. If run, and not stopped, add a new scheduled action to the scheduler

GameZero.tickFunction

Run a repeated scheduled action if due. If run, this method will add a new scheduled action to the scheduler

GameZero.tick!Method

Run all actions in the global scheduler that are due