Hey guys,
I wrote a basic who's that pokemon app today and im trying to add scores and lives.
First for lives I diclare this near the begining of my .m file
when a wrong pokemon name is picked it runs this method
the ball variable refer to pictures, it hides the 3 pokeballs to show you missed 3 pokemon. When it runs the first time it works fine. but after the first time it skips to health ==1 for some reason.
any insight?
I wrote a basic who's that pokemon app today and im trying to add scores and lives.
First for lives I diclare this near the begining of my .m file
Code:
#import "Who_s_That_Pokemon_ViewController.h"
@implementation Who_s_That_Pokemon_ViewController
int health = 4;
when a wrong pokemon name is picked it runs this method
Code:
-(void) calcHealth {
if (health == 1)
{
ball3.hidden= NO;
}
else if (health == 2)
{
ball1.hidden = YES;
health = health - 1;
}
else if (health == 3)
{
ball2.hidden == YES;
health = health - 1;
}
else if (health == 4)
{
ball3.hidden = YES;
health = health - 1;
}
}
any insight?