added swipe on Story Mode. So if playing a duel on story mode, you can cancel with swipe down.

This commit is contained in:
anthonycalosa@gmail.com
2013-06-13 04:34:20 +00:00
parent b3f81e95bb
commit 95bbe06c7e
2 changed files with 15 additions and 1 deletions

View File

@@ -22,7 +22,7 @@ public:
void Update(float dt);
void Render();
void ButtonPressed(int controllerId, int controlId);
void OnScroll(int inXVelocity, int inYVelocity);
};
#endif

View File

@@ -129,3 +129,17 @@ void GameStateStory::ButtonPressed(int controllerId, int controlId)
}
}
void GameStateStory::OnScroll(int, int inYVelocity)
{
if (abs(inYVelocity) > 300)
{
bool flickUpwards = (inYVelocity < 0);
int velocity = (inYVelocity < 0) ? (-1 * inYVelocity) : inYVelocity;
while(velocity > 0)
{
mEngine->HoldKey_NoRepeat(flickUpwards ? JGE_BTN_DOWN : JGE_BTN_UP);
velocity -= 100;
}
}
}