added swipe on Story Mode. So if playing a duel on story mode, you can cancel with swipe down.
This commit is contained in:
@@ -22,7 +22,7 @@ public:
|
|||||||
void Update(float dt);
|
void Update(float dt);
|
||||||
void Render();
|
void Render();
|
||||||
void ButtonPressed(int controllerId, int controlId);
|
void ButtonPressed(int controllerId, int controlId);
|
||||||
|
void OnScroll(int inXVelocity, int inYVelocity);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user