What is a Game Loop?
Learn about the concept of a game loop and build a simple square oscillator game.
We'll cover the following...
What is a game loop?
Building a game is an exciting topic, but at the same time, it can become too complex to develop high-end games. Since our focus will primarily be on using data structures and different algorithms to build small but real-world games, in this course, it becomes essential to know the basics of developing a game. Generally, while developing any game, there is an important concept called game loop.
A game loop is a loop that keeps on executing unless the user exits the game or the game is over. There are usually three steps involved in any game loop.
Let's talk about each of the them below:
Initialization: The initialization logic is executed whenever a game is loaded. All of the initialization-related logic for the game needs to be executed in this step. Written under this step is usually any logic that only needs to be executed once, at the start of the game.
Loop: The loop is executed forever, until the user stops the game or the game ends. Inside this loop, two significant logics need to be implemented. Both these logics work together to ...