This is a follow up from my previous question
I have this code
basically its meant to when the timer reaches you get a message box saying well done ect and then the screen resets and you get to play again, all the images reset and the start button re appears but you cant clear the alert box its just frozen on the sim, am i missing something out here?
heres the code
if (MainInt <= 0)
{
[timer invalidate];
timelabel.text = @"5";
[startbutton setHidden:NO];
CGRect frame = [player frame];
frame.origin.x = 137.0f;
frame.origin.y = 326.0;
[player setFrame:frame];
CGRect frame2 = [enemy frame];
frame2.origin.x = 90.0f;
frame2.origin.y = 20.0;
[enemy setFrame:frame2];
CGRect frame3 = [enemy2 frame];
frame3.origin.x = 210.0f;
frame3.origin.y = 20.0;
[enemy2 setFrame:frame3];
UIAlertView *alert1 = [[UIAlertView alloc] initWithTitle:@"GRATZ" message:[NSString stringWithFormat: @"Congratulations you made it to Level : %d Now try then next level" ,fred] delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil];
[alert1 show];
[alert1 release];
}
It sounds like you are creating more than one and putting them all on top of each other.
Try resetting your
MainInt = 5;like you were with yourtimeLabel.textin your previous question