Swipe down

Ive been trying to figure this out for a while now and its been doing my head in. Basically I’m creating a scroller game of 3 platforms of which the player can jump up or down through different controls. I have 3 Y values set for the 3 different positions, so far the “Tap” screen makes player jump but now I want a simple swipe down function to drop back down. 

How would I detect a swipe down event?

(also I have looked at the corona labs swipe direction guide, but I’m looking for a more simple “swipe” then - 80 on Y kinda thing)

Thanks in advance 

Easiest way:

local eventX local eventY local function testSwipe1(event) if event.phase == "began" then eventX = event.x eventY = event.y end if event.phase == "ended" then if event.y \> eventY+10 then -- using +10 value here to prevent false swipes -- perform your desired actions upon swiping print("FUNCTION WORKING") end end end Runtime:addEventListener("touch", testSwipe1)

YMMV

Thanks for the reply Panic, that seemed to have done the trick. Thanks again.

Easiest way:

local eventX local eventY local function testSwipe1(event) if event.phase == "began" then eventX = event.x eventY = event.y end if event.phase == "ended" then if event.y \> eventY+10 then -- using +10 value here to prevent false swipes -- perform your desired actions upon swiping print("FUNCTION WORKING") end end end Runtime:addEventListener("touch", testSwipe1)

YMMV

Thanks for the reply Panic, that seemed to have done the trick. Thanks again.