如果分数可以被10整除,如何重置倒数计时器?
这是得分方法
-(void)setScore:(int)score
{
_score = score;
scoreLabel.text = [NSString stringWithFormat:@"Score: %d", score];
}
倒计时的更新方法
-(void)update:(CFTimeInterval)currentTime {
/* Called before each frame is rendered */
if (startGamePlay) {
startTime = currentTime;
startGamePlay = NO;
}
int countDownInt = 10.0 - (int)(currentTime - startTime);
timeLabel.text = [NSString stringWithFormat:@"%i", countDownInt];
if (self.score % 10 == 0) {
//reset countDownInt here
}
}