Rough implementation of the game engine