How to add animation to your xcode project using the AnimatedImages Class.
Flappy Bird Clone tutorial: • Flappy Birds Xcode Tutorials - Quick ...
Here's a link to a zip of the assets used in this project:
https://dl.dropboxusercontent.com/u/2...
Here is the key code for this tutorial:
This goes in the iBAction
NSArray * imageArray = [[NSArray alloc] initWithObjects:
[UIImage imageNamed:@"coin1.png"],
[UIImage imageNamed:@"coin2.png"],
[UIImage imageNamed:@"coin3.png"],
[UIImage imageNamed:@"coin4.png"],
[UIImage imageNamed:@"coin5.png"],
[UIImage imageNamed:@"coin6.png"],
[UIImage imageNamed:@"coin7.png"],
[UIImage imageNamed:@"coin8.png"],
[UIImage imageNamed:@"coin9.png"],
[UIImage imageNamed:@"coin10.png"],
[UIImage imageNamed:@"coin11.png"],
[UIImage imageNamed:@"coin12.png"],
[UIImage imageNamed:@"coin13.png"],
[UIImage imageNamed:@"coin14.png"],
nil];
imgView = [[UIImageView alloc] initWithFrame:
CGRectMake(0, 125, 150, 130)];
imgView.animationImages = imageArray;
imgView.animationDuration = 1;
imgView.contentMode = UIViewContentModeBottomLeft;
[self.view addSubview:imgView];
[imgView startAnimating];
[self performSelector:@selector(stopTheAnimation) withObject:nil afterDelay:3.0];
And this is the stopTheAnimation method:
-(void)stopTheAnimation{
[imgView stopAnimating];
coin.hidden=FALSE;
}