Coding the game engine