I have a game where a bird files to a number of perches,
I need to detect a collision with the perch
Rather then using a load of if statements, I would like to refer to them in an array.
if (CGRectIntersectsRect(bird.frame, perch1.frame)) { }
if (CGRectIntersectsRect(bird.frame, perch2.frame)) { }
if (CGRectIntersectsRect(bird.frame, perch3.frame)) { } and so on……
NSMutableArray* percharray = [NSMutableArray array];
[percharray addObject

erch1]; // Smilie is a Colon ?
[percharray addObject

erch2];
[percharray addObject

erch3];
... etc
for (int i = 0; i < num_perches; i++) {
if (CGRectIntersectsRect(bird.frame, percharray[i].frame)) { code her }
}
But I get error
‘struct NSMutbleArray’ has no member named ‘frame’
Any help please