Описание тега game-loop
The central component of any game, from a programming standpoint, is the game loop. The game loop allows the game to run smoothly regardless of a user's input or lack thereof.
The game loop is the central component of any game and it is generally split into three different pieces: initialization, update, and draw (or render).
During the initialization phase, the game is set up and the environment is prepared for the update and draw routines.
During the update phase, all of the objects and components of the game are updated based on the game's logic, user's input and the time since the last update routine.
During the draw or render phase, all of the objects and components of the game are drawn or rendered to the viewport based on the most recent update.
Once the current frame is rendered, the game loop repeats the execution of the update statements based on the new delta time and then renders again.