Quote:
Originally Posted by Sesa
can anyone please help me with this Collision code: i want to make a collision between the elephant and the flakeImage, but it dosent work.
|
You're using beginAnimations/commitAnimations to animation an image from the top of the screen to the bottom, right? And then you're checking for collisions once, right after you start the animation.
In my experience CGRectIntersectsRect and beginAnimations/commitAnimations do not mix well. flakeImage.frame will return the endpoint of the animation, not the real current position of the flake. I would pick a reasonable framerate like 15 or 20 FPS and update the positions yourself, without using beginAnimations/commitAnimations.
I also don't see an array of flakes. CheckCollision needs to loop through the array of flakes and check each one against the elephant.