game loop
A game loop coordinates repeated input, simulation, and rendering.
Use this when Gameplay updates are spread across unrelated timers.
without the term
“My game has a bunch of setIntervals moving different things, and enemies and the player get out of sync, especially when the tab lags. How should the game update properly?”
with the term · How do you ask a model for game loop?
Organize this simulation around the engine’s update loop. Verify update order, pause behavior, and rendering without advancing the simulation twice.
What is game loop?
Each frame, the loop reads input, advances the simulation, and draws. Keeping state changes in the update step and out of the draw step keeps the game consistent.
Why does game loop matter when vibe coding?
Independent update paths can process the same frame inconsistently.
How do you do game loop?
Choose the engine’s supported update phases and keep state changes separate from drawing.
What goes wrong with game loop?
Adding another timer that mutates the same simulation state outside its update phase.