Count down timer
- by Ohmnastrum
I have a timer set up and it gets called when ever the player is in their turn phase. I also have a multiplier that decrements slowly while the player is committing actions.
for some odd reason my mult variable is returning garbage values I initialized it to 1 in the onLoad statement but it still seems to have trouble.
-(void) Timerbar:(NSTimer *)barTimer {
if(!waitForPlayer) {
[barTimer invalidate];
}
if(mult > 0.0) {
mult -= 0.01;
if(mult < 0) {
mult = 0;
}
}
power = (mult * 10) / pwrBarMaxWidth;
pwrBarWidth = (int)power % limit;
NSLog(@"%d", mult);
}
Do I have a syntax error somewhere?