From 17eefed08fa052b39c9ee4c4cb486794a8551c92 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 17 Apr 2016 11:36:40 +0200 Subject: Improved gestures system --- examples/core_gestures_detection.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'examples') diff --git a/examples/core_gestures_detection.c b/examples/core_gestures_detection.c index a5cf8e69..63a1e6bd 100644 --- a/examples/core_gestures_detection.c +++ b/examples/core_gestures_detection.c @@ -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 -- cgit v1.2.3