Skip to content

Commit

Permalink
Fixed Control issues (smash attacks)
Browse files Browse the repository at this point in the history
Fixed an apparent issue with smash attacks that I somehow never
noticed...
  • Loading branch information
lufinkey authored and lufinkey committed Oct 22, 2014
1 parent bfd3beb commit 6715c11
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 11 deletions.
8 changes: 5 additions & 3 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.21</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<string>2.21</string>
<key>LSRequiresIPhoneOS</key>
<false/>
<key>UIStatusBarHidden</key>
<true/>
<key>UIInterfaceOrientation</key>
<string>UIInterfaceOrientationLandscapeRight</string>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
Expand Down
59 changes: 51 additions & 8 deletions Source/SmashBros/Controls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,7 @@ namespace SmashBros
Player*playr=Global::getPlayerActor(pNum);
playr->checkAttacks();
playr->smashTime=0;
playr->runTime=0;
playr->buttondir=0;
playr->down=false;
playr->up=false;
Expand Down Expand Up @@ -1091,6 +1092,7 @@ namespace SmashBros
playr->checkAttacks();
playr->buttondir=0;
playr->smashTime=0;
playr->runTime=0;
playr->down=false;
playr->up=false;
playr->upKey=false;
Expand Down Expand Up @@ -1118,6 +1120,14 @@ namespace SmashBros
Player*playr=Global::getPlayerActor(pNum);
if(playr->attacksPriority!=-1)
{
if(!joystickDown[pNum])
{
playr->smashTime = Global::worldTime+100;
}
else
{
playr->smashTime = 0;
}
playr->buttondir=1;
playr->moveLeft=0;
playr->moveRight=0;
Expand Down Expand Up @@ -1157,7 +1167,14 @@ namespace SmashBros
Player*playr=Global::getPlayerActor(pNum);
if(playr->attacksPriority!=-1)
{

if(!joystickDown[pNum] || justPulled[pNum])
{
playr->smashTime = Global::worldTime+100;
}
else
{
playr->smashTime = 0;
}
playr->buttondir=1;
if((joystickDir[pNum] == PrimitiveActor::DIR_UPLEFT)||(joystickDir[pNum] == PrimitiveActor::DIR_UPRIGHT))
{
Expand Down Expand Up @@ -1402,6 +1419,10 @@ namespace SmashBros
playr->down=false;
playr->moveRight=0;
playr->moveLeft=1;
if(justPulled[pNum] || joystickDir[pNum]==0)
{
playr->runTime = Global::worldTime+200;
}
if(playr->hanging && !((joystickDir[pNum]==PrimitiveActor::DIR_LEFT || joystickDir[pNum]==PrimitiveActor::DIR_DOWNLEFT) && joystickFar[pNum])
&& joystickDir[pNum]!=PrimitiveActor::DIR_UPLEFT)
{
Expand Down Expand Up @@ -1439,9 +1460,10 @@ namespace SmashBros
playr->upKey=false;
playr->down=false;
playr->moveRight=0;
if(justPulled[pNum])
if(justPulled[pNum] || playr->runTime>Global::getWorldTime())
{
playr->moveLeft=2;
playr->smashTime = Global::worldTime+100;
}
else
{
Expand Down Expand Up @@ -1485,6 +1507,10 @@ namespace SmashBros
playr->down=false;
playr->moveLeft=0;
playr->moveRight=1;
if(justPulled[pNum] || joystickDir[pNum]==0)
{
playr->runTime = Global::worldTime+100;
}
if(playr->hanging && !((joystickDir[pNum]==PrimitiveActor::DIR_RIGHT || joystickDir[pNum]==PrimitiveActor::DIR_DOWNRIGHT) && joystickFar[pNum])
&& joystickDir[pNum]!=PrimitiveActor::DIR_UPRIGHT)
{
Expand Down Expand Up @@ -1522,9 +1548,10 @@ namespace SmashBros
playr->upKey=false;
playr->down=false;
playr->moveLeft=0;
if(justPulled[pNum])
if(justPulled[pNum] || playr->runTime>Global::getWorldTime())
{
playr->moveRight=2;
playr->smashTime = Global::worldTime+100;
}
else
{
Expand Down Expand Up @@ -1568,6 +1595,14 @@ namespace SmashBros
playr->upKey=false;
playr->down = true;
playr->checkAttacks();
if(!joystickDown[pNum] || justPulled[pNum])
{
playr->smashTime = Global::worldTime+100;
}
else
{
playr->smashTime = 0;
}
if((playr->isOnGround())&&(playr->canDo)&&(!playr->isGrabbing())&&(!playr->hasGrabbed())&&(!playr->isGrabbed()))
{
playr->changeTwoSidedAnimation("crouch", NO_CHANGE);
Expand All @@ -1589,6 +1624,14 @@ namespace SmashBros
{
playr->buttondir=3;
playr->checkAttacks();
if(!joystickDown[pNum] || justPulled[pNum])
{
playr->smashTime = Global::worldTime+100;
}
else
{
playr->smashTime = 0;
}
if(justPulled[pNum] && playr->canDo)
{
playr->moveDown();
Expand Down Expand Up @@ -2203,7 +2246,7 @@ namespace SmashBros
playr->moveLeft=1;
if(playr->isOnGround())
{
playr->runTime=Global::worldTime+100;
playr->runTime=Global::worldTime+200;
}
}
if(playr->hanging)
Expand Down Expand Up @@ -2387,7 +2430,7 @@ namespace SmashBros
break;

case 1:
if(Global::worldTime<=playr->smashTime+1)
if(Global::worldTime<=playr->smashTime)
{
playr->attackUpSmash(Player::STEP_CHARGE);
if(playr->jumping)
Expand All @@ -2403,7 +2446,7 @@ namespace SmashBros
break;

case 2:
if(Global::worldTime<=playr->smashTime+1)
if(Global::worldTime<=playr->smashTime)
{
playr->attackSideSmash(Player::STEP_CHARGE);
}
Expand All @@ -2414,7 +2457,7 @@ namespace SmashBros
break;

case 3:
if(Global::worldTime<=playr->smashTime+1)
if(Global::worldTime<=playr->smashTime)
{
playr->attackDownSmash(Player::STEP_CHARGE);
playr->canDropThrough=false;
Expand All @@ -2428,7 +2471,7 @@ namespace SmashBros
break;

case 4:
if(Global::worldTime<=playr->smashTime+1)
if(Global::worldTime<=playr->smashTime)
{
playr->attackSideSmash(Player::STEP_CHARGE);
}
Expand Down

0 comments on commit 6715c11

Please sign in to comment.