diff options
author | Starla Insigna <starla4444@gmail.com> | 2011-09-10 14:33:27 -0400 |
---|---|---|
committer | Starla Insigna <starla4444@gmail.com> | 2011-09-10 14:33:27 -0400 |
commit | 5ccc4fc305f502a552b1ac7e815e576c93a8159a (patch) | |
tree | 5bf4ede55160769ab74ffde1488f5382ed3ba93f /Classes/JumpGameMode.m | |
parent | f7ce2c458df032f65c4c1eb31cf705bb284a3ee7 (diff) | |
download | cartcollect-0.4.6.tar.gz cartcollect-0.4.6.tar.bz2 cartcollect-0.4.6.zip |
Jump: Allowed cart to be pushed off side of screen when below ledges v0.4.6
Closes #227
Diffstat (limited to 'Classes/JumpGameMode.m')
-rw-r--r-- | Classes/JumpGameMode.m | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Classes/JumpGameMode.m b/Classes/JumpGameMode.m index e4f3c8b..15b0e16 100644 --- a/Classes/JumpGameMode.m +++ b/Classes/JumpGameMode.m | |||
@@ -179,13 +179,24 @@ | |||
179 | 179 | ||
180 | [super tick:dt]; | 180 | [super tick:dt]; |
181 | 181 | ||
182 | if ((cart.sprite.position.y < 86) && (cart.boundedByScreen)) | ||
183 | { | ||
184 | cart.boundedByScreen = NO; | ||
185 | } | ||
186 | |||
182 | if (cart.sprite.position.y == (0-cart.sprite.boundingBox.size.height/2)) | 187 | if (cart.sprite.position.y == (0-cart.sprite.boundingBox.size.height/2)) |
183 | { | 188 | { |
184 | [self setLives:self.lives-1]; | 189 | [self setLives:self.lives-1]; |
190 | cart.boundedByScreen = YES; | ||
185 | 191 | ||
186 | [[SimpleAudioEngine sharedEngine] playEffect:[[NSBundle mainBundle] pathForResource:@"Damage1" ofType:@"wav"]]; | 192 | [[SimpleAudioEngine sharedEngine] playEffect:[[NSBundle mainBundle] pathForResource:@"Damage1" ofType:@"wav"]]; |
187 | 193 | ||
188 | cart.sprite.position = ccp(cart.sprite.position.x, 320 + cart.sprite.boundingBox.size.height/2); | 194 | if (cart.sprite.position.x < cart.sprite.boundingBox.size.width/2) |
195 | { | ||
196 | cart.sprite.position = ccp(cart.sprite.boundingBox.size.width, 320 + cart.sprite.boundingBox.size.height/2); | ||
197 | } else { | ||
198 | cart.sprite.position = ccp(cart.sprite.position.x, 320 + cart.sprite.boundingBox.size.height/2); | ||
199 | } | ||
189 | } | 200 | } |
190 | 201 | ||
191 | if (lives <= 0) | 202 | if (lives <= 0) |