Clocks#
PPB has several ways to mark time: fixed-rate updates, frames, and idle time. These are all exposed via the event system.
Updates#
The ppb.events.Update
event is fired at a regular, fixed rate
(defaulting to 60 times a second). This is well-suited for simulation updates,
such as motion, running NPC AIs, physics, etc.
Frames#
The ppb.events.PreRender
and ppb.events.Render
are fired
every frame. This is best used for particle systems, animations, and anything
that needs to update every rendered frame (even if the framerate varies).
Idle#
ppb.events.Idle
is fired whenever the core event loop has no more
events. While this is primarily used by systems for various polling things, it
may be useful for games which have low-priority calculations to perform.