0

我正在快速编写一个小游戏,其中一艘船必须绕过障碍物。但是,我在 CGRectInersectsRect 中不断收到此“调用中的参数 #2 缺少参数”错误。我已经检查了如何在目录中调用它,并且正确调用它。我的代码有什么问题?这里是:

 if (CGRectIntersectsRect(boat: CGRect, obstacleImageView: CGRect)) {
        endGame()
    }
}
4

1 回答 1

0

if (CGRectIntersectsRect(boat.frame, obstacleImageView.frame)) { endGame() } }

CGRect是参数的一种类型。调用函数时不应使用它。

于 2016-08-31T11:58:38.823 回答