In my application I want an object to slide and jump on touch began event in Corona. Although I am successful in implementing both slide and jump on touch ended event, but making event phase at began I can’t do slide.
I use the following code for sliding and jumping:
function touched( event )
if(event.phase == "ended") then
if(event.x - event.xStart > 70) then
sliding = true;
offGround = true;
else
boy:applyLinearImpulse(0, -0.44, boy.x, boy.y)
offGround = true;
end
end
end
I have done this. I use moved phase and mark a boolean active on move phase and call a timer function at began. Here is my code.