Refactor of space simulator to work with game loop