Just a quick issue when my app reloads two images collide without actually touching. I have reset the frames of these images to their original positioning i did as follows:
-(void)viewWillAppear:(BOOL)animated {
redball.frame = CGRectMake(redballpos.x, redballpos.y, redball.frame.size.width, redball.frame.size.height); //makes frame
ball1.frame = CGRectMake(ball1pos.x, ball1pos.y, ball1.frame.size.width, ball1.frame.size.height);
ball2.frame = CGRectMake(ball2pos.x, ball2pos.y, ball2.frame.size.width, ball2.frame.size.height);
}
and my original ViewDidload is as follows:
- (void)viewDidLoad
{
redballpos = redball.frame.origin;
ball1pos = ball1.frame.origin;
ball2pos = ball2.frame.origin;
exit.hidden = YES;
ball2.hidden = YES;
highScore = [[NSUserDefaults standardUserDefaults] integerForKey:@"HighScoreSaved"];
adView.delegate = self;
[super viewDidLoad];
}
Would anyone know what i am doing wrong? All advice would be much appreciated