
A simple game can be thought of as having three modules. Create, Update and Render. Create module creates the world, characters with default values. We create World class, Character Class. Create Player class, Enemy class extending from Character class. Each characters will initialize with its default values like default position, default texture, etc. Each Character will have update() function and render() function to update its own value and render it self.
createWorld(); createCharacters();
Update module will read the input received from user and update the player position. Based on situation in the game, we also update enemy position, texture etc.
Foreach(Character c in characters){ update(c); }
Render module: Once all the values are updated. We go through each objects of the game and render them one by one.
For each(Character c in characters){ c.render(); }
The game will loop between update module and render module as long as its game over or user exits the game.
This pseudo code of a simple game might need sound, score, saving game state, different levels etc.