In its core, every game is basically just a loop of events. It is a set up to give calls to various functions and code blocks to execute in order to have draw calls on your screen, and thereby making the game playable. Mostly, your game comprises three parts:
Initializing the game means to set an entry point to your game through which the other two parts can be called. Your game begins here and is called just once.
Once your game is initialized, you need to start giving calls to your events that can be managed through your update function.
The draw function is responsible for drawing all your image data on the screen. Everything you see on the screen including your backgrounds, images, or even your GUI is ...