timer_event_periodic
Timer raising an event at a fixed period (spawn objects regularly).
Derives from: timer_basic
Fields and methods
Members of the struct timer_event_periodic. Most of what you do with a CGP type goes through the free functions listed below.
Fields
bool event | True only after an update() during which event_period elapsed since the previous event, false otherwise. |
float t_periodic | Time in seconds accumulated since the last event, reset when it reaches event_period. |
float event_period | Time in seconds between two events, 1 by default. |
Methods
| Builds a running timer that raises event every event_period seconds (1 by default). src | |
| Advances t as timer_basic::update(), adds the step to t_periodic and sets event to true if t_periodic reaches event_period (then subtracts event_period, or resets it to 0 if several periods elapsed), and returns the time step. src |
Inherited from timer_basic (4 members)
Fields
float t | Accumulated time in seconds, multiplied by scale, 0 until the second update(). |
float scale | Multiplier applied to the elapsed real time (1 by default; larger values accelerate the animation). |
Functions taking a timer_event_periodic
None.
Functions returning a timer_event_periodic
None.
Operators
None.