Expand description
Everything about time: frame timing, game-time scheduling and simple timers.
There are two kinds of time in the engine:
- Game time (
Time, reachable asctx.time). It advances once per frame, can be slowed down or paused withTime::set_scale, and drives the scheduler (Time::after,Time::every,Time::fired). - Real time (
Timer,Cooldown,Interval). These are standalone objects you keep in your own structs. They measure wall clock time and work without a context.
Structsยง
- Cooldown
- Limits how often something can happen, e.g. firing a weapon.
- Interval
- Fires at a fixed real-time rate. Great for footsteps, radar beeps or clocks.
- Time
- Frame timing and a simple named-event scheduler. Available as
ctx.time. - Timer
- A stopwatch measuring real time. Can be paused, resumed and restarted.