Updated game loop in sample