integrate game loop