diff options
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) |