I have a game in which the players will go one after the other and then the view will quit and go to a different view, currently i have coded as so
This doesn't seem to be working. If anyone knows of a way I can simply organize the scores into highest to lowest I would be very grateful.
HTML:
int winner1;
int winner2;
int winner1S;
int winner2S;
int winner;
if (Player1Score < Player2Score) {
winner1=1;
winner1S=Player1Score;
} else {
winner1=2;
winner1S=Player2Score;
}
if (Player3Score < Player4Score) {
winner2=3;
winner2S=Player3Score;
} else {
winner2=4;
winner2S=Player4Score;
}
if (winner2S < winner1S) {
winner=winner2;
} else {
winner=winner1;
}
NSString *winnerstring = [[NSString alloc] initWithFormat:@"%d", winner];
[[NSUserDefaults standardUserDefaults] setObject:winnerstring forKey:@"CCW"];
[self.delegate CreatureCaptureDidFinish:self];
This doesn't seem to be working. If anyone knows of a way I can simply organize the scores into highest to lowest I would be very grateful.