Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Store variable and Run loop when the game is over

julthebaberjulthebaber CanadaPosts: 37New Users @
I have made a simple game just to test my knowledge(Similar to flappy bird). When the game is over i'd like to run a loop. The loop would make the bird go down from is current Y position to the Y position i choosed which is 514(to simulate the bird falling down and hitting the ground). This is my GameOver method:
-(void)GameOver{

if (ScoreNumber > HighScoreNumber) {
    [[NSUserDefaults standardUserDefaults] setInteger:ScoreNumber forKey:@"HighScoreSaved"];
}

[TunnelMovement invalidate];
[BirdMovement invalidate];

Exit.hidden = NO;
/*
TunnelTop.hidden = YES;
TunnelBottom.hidden =YES;
Bird.hidden = YES;
 */

}

So i'd like to save the current Y position of the bird. Store that variable and run a loop that would make it go from the current y position to the y position 514. Could someone guide me through that process? Thanks
Tagged:
Sign In or Register to comment.