Improved gestures system

This commit is contained in:
raysan5 2016-04-17 11:36:40 +02:00
parent 2e5d898443
commit 17eefed08f
5 changed files with 12 additions and 14 deletions

View file

@ -43,12 +43,11 @@ int main()
// Update
//----------------------------------------------------------------------------------
lastGesture = currentGesture;
currentGesture = GetGestureDetected();
touchPosition = GetTouchPosition(0);
if (CheckCollisionPointRec(touchPosition, touchArea) && IsGestureDetected())
if (CheckCollisionPointRec(touchPosition, touchArea) && (currentGesture != GESTURE_NONE))
{
currentGesture = GetGestureType();
if (currentGesture != lastGesture)
{
// Store gesture string
@ -78,7 +77,6 @@ int main()
}
}
}
else currentGesture = GESTURE_NONE;
//----------------------------------------------------------------------------------
// Draw