Move game-loop procedure out of run-game-loop.