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