Skip to content

Commit c1c9c74

Browse files
author
Joshua Howland
committed
Tweaked 2nd powerup usage and added missed eligibility check
1 parent 35282c0 commit c1c9c74

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

SHIV-IOS2014/SKPMyScene.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
271271
[self blastPowerUp];
272272
}
273273
}else if(dY<-minfac){
274-
if(!_using2ndPowerup){
274+
if(!_using2ndPowerup && _eligiblefor2ndPowerup>0){
275275
_using2ndPowerup = true;
276276
_eligiblefor2ndPowerup = -2000;
277277
_powerup2Timer = 500;
@@ -474,6 +474,11 @@ -(void)gameOver{
474474
}
475475

476476

477+
/*
478+
Utility method that deals with removing the second powerup.
479+
@param: none
480+
@return: none
481+
*/
477482
-(void)removeSecondPowerup{
478483
[_sheildPowerup removeFromParent];
479484
_using2ndPowerup = false;
@@ -557,6 +562,7 @@ -(void)update:(CFTimeInterval)currentTime {
557562
if([_player intersectsNode:tempBlock.blockSprite]){
558563
if(_using2ndPowerup){
559564
[self removeSecondPowerup];
565+
[self blastPowerUp];
560566
}else{
561567
[self gameOver];
562568
}

0 commit comments

Comments
 (0)