Implement basic game loop.