我必须制作一个包含图像的数组,然后检查另一个图像是否与它们发生冲突。
到目前为止,我已经尝试过:
NSMutableArray *platforms = [NSMutableArray array];
[platforms addObject:platform1];
[platforms addObject:platform2];
[platforms addObject:platform3];
[platforms addObject:platform4];
[platforms addObject:platform5];
[platforms addObject:platform6];
[platforms addObject:platform7];
[platforms addObject:platform8];
for (platforms in platforms) << code not working needs to do this for the amount of platforms in the array
{
if(CGRectIntersectsRect(ball.frame, platforms.frame))
{
}
}
虽然这段代码不起作用。
还有其他方法可以做到这一点吗?