Class AS::TickTimer
In: lib/as_timer.rb
Parent: Object

TickTimers keep a constant amount of time between ticks, calling a block of code if there is time before the tick ends.

Methods

new   seconds   sleep   tick_end_time  

Attributes

on_time  [R]  False if the timer is behind this tick.
step  [R]  The timestep for each tick. 1.0/(ticks per second)
ticks  [R]  The current tick count.

Public Class methods

Create a timer object with the given ticks per second and maximum frameskip.

Public Instance methods

Delay until the end of the tick. Returns False if the timer has fallen behind.

Returns a float value for the end of the tick. Can be compared against Time.now.to_f().

[Validate]