Almost every game can be thought of as having one main function that contains all the game logic, and which is run either when the user does something, or after a certain amount of time. This cycle of running the same core function over and over again is called the game loop, and is crucial to understand for any sort of game development.Source: http://active.tutsplus.com/tutorials/games/understanding-the-game-loop-basix/
At the heart of all games is a cycle which runs over-and-over; this is necessary, because, unlike a typical program, a game is required to listen, calculate and draw to screen constantly! For each iteration of the loop, certain elements are required to be run in sequence - they are as follows:

- Input: Check for user input and dispatch any keystrokes or mouse clicks detected.
- Resume: Check all paused coroutines for any that need to be resumed. If their time is up, resume them right where they left off.
- Update: Update all Elements, which will advance their positions, fire events, check for collisions, etc.
- Draw: Render all visible Elements to the screen.