summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStarla Insigna <starla4444@gmail.com>2011-09-05 00:20:44 -0400
committerStarla Insigna <starla4444@gmail.com>2011-09-05 00:20:44 -0400
commitd279ad58f35364adf3b38dd0de82aa4848a69390 (patch)
tree5471d597f4454088c5f81ea9f15e156423dce6cc
parentb8d8e6086eacd904d582efa4107ff183275a69bc (diff)
downloadcartcollect-d279ad58f35364adf3b38dd0de82aa4848a69390.tar.gz
cartcollect-d279ad58f35364adf3b38dd0de82aa4848a69390.tar.bz2
cartcollect-d279ad58f35364adf3b38dd0de82aa4848a69390.zip
Tweaked difficulty of Jump mode
The rate of dropped items now increases progressively like the speed of ledge scrolling. The scores at which two rocks and three rocks start appearing have also doubled.

Refs #204
-rw-r--r--Classes/JumpGameMode.h2
-rw-r--r--Classes/JumpGameMode.m50
2 files changed, 10 insertions, 42 deletions
diff --git a/Classes/JumpGameMode.h b/Classes/JumpGameMode.h index f6a31f8..0d23317 100644 --- a/Classes/JumpGameMode.h +++ b/Classes/JumpGameMode.h
@@ -25,7 +25,7 @@
25 float addSpeed; 25 float addSpeed;
26} 26}
27 27
28- (void)accelerateLedgeScrolling; 28- (void)accelerateGame;
29- (void)randomlyAddObject:(ccTime)dt; 29- (void)randomlyAddObject:(ccTime)dt;
30- (void)incrementScore; 30- (void)incrementScore;
31 31
diff --git a/Classes/JumpGameMode.m b/Classes/JumpGameMode.m index bac3fa5..f03eae0 100644 --- a/Classes/JumpGameMode.m +++ b/Classes/JumpGameMode.m
@@ -73,7 +73,7 @@
73{ 73{
74 [super onEnterTransitionDidFinish]; 74 [super onEnterTransitionDidFinish];
75 75
76 [self schedule:@selector(accelerateLedgeScrolling) interval:ledgeAccelerationRate]; 76 [self schedule:@selector(accelerateGame) interval:ledgeAccelerationRate];
77 [self schedule:@selector(randomlyAddObject:) interval:addSpeed]; 77 [self schedule:@selector(randomlyAddObject:) interval:addSpeed];
78 [self schedule:@selector(incrementScore) interval:1.0f]; 78 [self schedule:@selector(incrementScore) interval:1.0f];
79 79
@@ -129,8 +129,6 @@
129 { 129 {
130 cart.sprite.position = ccp(cart.sprite.position.x-ledgeScrollSpeed, cart.sprite.position.y); 130 cart.sprite.position = ccp(cart.sprite.position.x-ledgeScrollSpeed, cart.sprite.position.y);
131 } 131 }
132
133 int lastScore = score;
134 132
135 [super tick:dt]; 133 [super tick:dt];
136 134
@@ -148,39 +146,6 @@
148 [self unscheduleAllSelectors]; 146 [self unscheduleAllSelectors];
149 147
150 [[CCDirector sharedDirector] replaceScene:[CCTransitionSlideInT transitionWithDuration:1.5f scene:[GameOverScene sceneWithScore:score gameMode:@"Jump"]]]; 148 [[CCDirector sharedDirector] replaceScene:[CCTransitionSlideInT transitionWithDuration:1.5f scene:[GameOverScene sceneWithScore:score gameMode:@"Jump"]]];
151 } else if (score > lastScore)
152 {
153 if ((lastScore < 240) && (score >= 240))
154 {
155 [self unschedule:@selector(randomlyAddObject:)];
156 [self schedule:@selector(randomlyAddObject:) interval:0.6f];
157 addSpeed = 0.6f;
158 } else if ((lastScore < 180) && (score >= 180))
159 {
160 [self unschedule:@selector(randomlyAddObject:)];
161 [self schedule:@selector(randomlyAddObject:) interval:0.7f];
162 addSpeed = 0.7f;
163 } else if ((lastScore < 120) && (score >= 120))
164 {
165 [self unschedule:@selector(randomlyAddObject:)];
166 [self schedule:@selector(randomlyAddObject:) interval:0.8f];
167 addSpeed = 0.8f;
168 } else if ((lastScore < 90) && (score >= 90))
169 {
170 [self unschedule:@selector(randomlyAddObject:)];
171 [self schedule:@selector(randomlyAddObject:) interval:0.9f];
172 addSpeed = 0.9f;
173 } else if ((lastScore < 60) && (score >= 60))
174 {
175 [self unschedule:@selector(randomlyAddObject:)];
176 [self schedule:@selector(randomlyAddObject:) interval:1.0f];
177 addSpeed = 1.0f;
178 } else if ((lastScore < 30) && (score >= 30))
179 {
180 [self unschedule:@selector(randomlyAddObject:)];
181 [self schedule:@selector(randomlyAddObject:) interval:2.0f];
182 addSpeed = 2.0f;
183 }
184 } 149 }
185 150
186 if (wave) 151 if (wave)
@@ -301,14 +266,17 @@
301 return NO; 266 return NO;
302} 267}
303 268
304- (void)accelerateLedgeScrolling 269- (void)accelerateGame
305{ 270{
306 [self unschedule:@selector(accelerateLedgeScrolling)]; 271 [self unschedule:@selector(accelerateGame)];
272 [self unschedule:@selector(randomlyAddObject:)];
307 273
308 ledgeScrollSpeed += 2; 274 ledgeScrollSpeed += 2;
309 ledgeAccelerationRate *= 2; 275 ledgeAccelerationRate *= 2;
276 addSpeed *= 0.8f;
310 277
311 [self schedule:@selector(accelerateLedgeScrolling) interval:ledgeAccelerationRate]; 278 [self schedule:@selector(randomlyAddObject:) interval:addSpeed];
279 [self schedule:@selector(accelerateGame) interval:ledgeAccelerationRate];
312} 280}
313 281
314- (void)randomlyAddObject:(ccTime)dt 282- (void)randomlyAddObject:(ccTime)dt
@@ -344,7 +312,7 @@
344 [objects addObject:object]; 312 [objects addObject:object];
345 [object release]; 313 [object release];
346 314
347 if (score >= 120) 315 if (score >= 240)
348 { 316 {
349 if (arc4random() % 100 > 80) 317 if (arc4random() % 100 > 80)
350 { 318 {
@@ -360,7 +328,7 @@
360 } 328 }
361 } 329 }
362 330
363 if (score >= 240) 331 if (score >= 480)
364 { 332 {
365 if (arc4random() % 100 > 80) 333 if (arc4random() % 100 > 80)
366 { 334 {