diff options
Diffstat (limited to 'Classes/GameMode.m')
-rw-r--r-- | Classes/GameMode.m | 22 |
1 files changed, 20 insertions, 2 deletions
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 @@ | |||
12 | 12 | ||
13 | @implementation GameMode | 13 | @implementation GameMode |
14 | 14 | ||
15 | @synthesize cart, score, lives, isPaused; | 15 | @synthesize cart, score, lives, isPaused, pointMultiplier; |
16 | 16 | ||
17 | + (CCScene*)scene | 17 | + (CCScene*)scene |
18 | { | 18 | { |
@@ -53,6 +53,7 @@ | |||
53 | 53 | ||
54 | score = 0; | 54 | score = 0; |
55 | lives = 3; | 55 | lives = 3; |
56 | pointMultiplier = 1; | ||
56 | 57 | ||
57 | if ([self canPause]) | 58 | if ([self canPause]) |
58 | { | 59 | { |
@@ -159,7 +160,12 @@ | |||
159 | { | 160 | { |
160 | score = m_score; | 161 | score = m_score; |
161 | 162 | ||
162 | [scoreLabel setString:[NSString stringWithFormat:@"Score: %d", score]]; | 163 | if (pointMultiplier > 1) |
164 | { | ||
165 | [scoreLabel setString:[NSString stringWithFormat:@"Score: %d x%d", score, pointMultiplier]]; | ||
166 | } else { | ||
167 | [scoreLabel setString:[NSString stringWithFormat:@"Score: %d", score]]; | ||
168 | } | ||
163 | } | 169 | } |
164 | 170 | ||
165 | - (void)setLives:(int)m_lives | 171 | - (void)setLives:(int)m_lives |
@@ -169,6 +175,18 @@ | |||
169 | [livesLabel setString:[NSString stringWithFormat:@"Lives: %d", lives]]; | 175 | [livesLabel setString:[NSString stringWithFormat:@"Lives: %d", lives]]; |
170 | } | 176 | } |
171 | 177 | ||
178 | - (void)setPointMultiplier:(int)m_pointMultiplier | ||
179 | { | ||
180 | pointMultiplier = m_pointMultiplier; | ||
181 | |||
182 | if (pointMultiplier > 1) | ||
183 | { | ||
184 | [scoreLabel setString:[NSString stringWithFormat:@"Score: %d x%d", score, pointMultiplier]]; | ||
185 | } else { | ||
186 | [scoreLabel setString:[NSString stringWithFormat:@"Score: %d", score]]; | ||
187 | } | ||
188 | } | ||
189 | |||
172 | - (void)scheduleDelayedAction:(void(^)(void))m_delayedAction delay:(float)delay | 190 | - (void)scheduleDelayedAction:(void(^)(void))m_delayedAction delay:(float)delay |
173 | { | 191 | { |
174 | delayedAction = Block_copy([m_delayedAction retain]); | 192 | delayedAction = Block_copy([m_delayedAction retain]); |