bevy/examples/games
Cameron 6929d95f7f Replace fixed timestep in alien_cake_addict example with timer (#5760)
# Objective

Examples should use the correct tools for the job.

## Solution

A fixed timestep, by design, can step multiple times consecutively in a single update.

That property used to crash the `alien_cake_addict` example (#2525), which was "fixed" in #3411 (by just not panicking). The proper fix is to use a timer instead, since the system is supposed to spawn a cake every 5 seconds. 

---

A timer guarantees a minimum duration. A fixed timestep guarantees a fixed number of steps per second.
Each one works by essentially sacrificing the other's guarantee.

You can use them together, but no other systems are timestep-based in this example, so the timer is enough.
2022-09-30 11:37:33 +00:00
..
alien_cake_addict.rs Replace fixed timestep in alien_cake_addict example with timer (#5760) 2022-09-30 11:37:33 +00:00
breakout.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
contributors.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
game_menu.rs Rename UiColor to BackgroundColor (#6087) 2022-09-25 00:39:17 +00:00