From ab9f7381455b334fa0df563e21775410be74ea45 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Sat, 10 Sep 2011 10:04:18 -0400 Subject: Added point multipliers There is support for point multipliers for any game mode, but only Jump currently utilizes it. Closes #222 --- Classes/GameMode.m | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'Classes/GameMode.m') diff --git a/Classes/GameMode.m b/Classes/GameMode.m index f0eb02f..1e80237 100644 --- a/Classes/GameMode.m +++ b/Classes/GameMode.m @@ -12,7 +12,7 @@ @implementation GameMode -@synthesize cart, score, lives, isPaused; +@synthesize cart, score, lives, isPaused, pointMultiplier; + (CCScene*)scene { @@ -53,6 +53,7 @@ score = 0; lives = 3; + pointMultiplier = 1; if ([self canPause]) { @@ -159,7 +160,12 @@ { score = m_score; - [scoreLabel setString:[NSString stringWithFormat:@"Score: %d", score]]; + if (pointMultiplier > 1) + { + [scoreLabel setString:[NSString stringWithFormat:@"Score: %d x%d", score, pointMultiplier]]; + } else { + [scoreLabel setString:[NSString stringWithFormat:@"Score: %d", score]]; + } } - (void)setLives:(int)m_lives @@ -169,6 +175,18 @@ [livesLabel setString:[NSString stringWithFormat:@"Lives: %d", lives]]; } +- (void)setPointMultiplier:(int)m_pointMultiplier +{ + pointMultiplier = m_pointMultiplier; + + if (pointMultiplier > 1) + { + [scoreLabel setString:[NSString stringWithFormat:@"Score: %d x%d", score, pointMultiplier]]; + } else { + [scoreLabel setString:[NSString stringWithFormat:@"Score: %d", score]]; + } +} + - (void)scheduleDelayedAction:(void(^)(void))m_delayedAction delay:(float)delay { delayedAction = Block_copy([m_delayedAction retain]); -- cgit 1.4.1