diff options
author | Starla Insigna <starla4444@gmail.com> | 2011-09-10 10:04:18 -0400 |
---|---|---|
committer | Starla Insigna <starla4444@gmail.com> | 2011-09-10 10:04:18 -0400 |
commit | ab9f7381455b334fa0df563e21775410be74ea45 (patch) | |
tree | 531ffb35abf20c8a75103a66c7de0a7136b11d24 /Classes/GameMode.m | |
parent | b090d12d637e5cfbf0ac6955fa6c8d401de657b5 (diff) | |
download | cartcollect-ab9f7381455b334fa0df563e21775410be74ea45.tar.gz cartcollect-ab9f7381455b334fa0df563e21775410be74ea45.tar.bz2 cartcollect-ab9f7381455b334fa0df563e21775410be74ea45.zip |
Added point multipliers
There is support for point multipliers for any game mode, but only Jump currently utilizes it. Closes #222
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]); |