1. 代码
CGRect rect1 = [self positionRect:sheep];
CGRect rect2
= [self positionRect:cow];
if (!CGRectIsNull(CGRectIntersection(rect1, rect2))) {
//handle collision
[sheep stopAction:jump_4ever];
}
2.然后 schedule 一个 1/30 或者 1/60 的 函数在里面进行检测。

相关文章:

  • 2022-01-09
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-12
猜你喜欢
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
相关资源
相似解决方案