Hey All,
I am new to iOS development I am a PHP developer.
I have started a really simple game... get the ball from the start point to the hole...
All working fine so far the ball rolls round the screen, doesn't go off the screen and when you get it in the hole an alert comes up and you can restart....
Anyway now I have that working I have decided to be more adventurous and add obstacles (UIImageViews) walls...
However I am really stuck... I have been stuck on this for weeks and google doesn't seem to help =(
The ball is rolling around the screen using the accelerometer... I added the wall into the .xib file and assigned the *wall I defined in the .h file...
But I can for the life of me stop the ball from rolling though the wall... I can detect a collision using this code:
Code:
if(CGRectIntersectsRect(ball.frame, wall1.frame)){
NSLog(@"Wall was hit");
}
Can anyone please help me in stopping the call from going through the wall, the users has to navigate round the wall.
Dan