Yes, I slightly modified code, so it can work now properly just pasted in. Also added walls for collision function witch shows same behavior as touch.
You can see that is possible to play with the swipe function on the ball if you catch it on the first transition, but it’s not possible on the next transitions.
centerX = display.contentCenterX centerY = display.contentCenterY screenLeft = display.screenOriginX screenWidth = display.contentWidth - screenLeft \* 2 screenRight = screenLeft + screenWidth screenTop = display.screenOriginY screenHeight = display.contentHeight - screenTop \* 2 screenBottom = screenTop + screenHeight display.contentWidth = screenWidth display.contentHeight = screenHeight local physics = require("physics") physics.start() local leftWall = display.newRect(screenLeft+1, centerY, 10, screenHeight) local topWall = display.newRect(centerX, screenTop+1, screenWidth, 10) local rightWall = display.newRect(screenRight-1, centerY, 10, screenHeight) local bottomWall = display.newRect(centerX, screenBottom-1, screenWidth, 10) leftWall.type = "wall" topWall.type = "wall" rightWall.type = "wall" bottomWall.type = "wall" physics.addBody(leftWall, "static") physics.addBody(rightWall, "static") physics.addBody(topWall, "static") physics.addBody(bottomWall, "static") local ball function ballFall() ball = display.newCircle(150, 20, 80) physics.addBody(ball, "dynamic") ball.gravityScale = 0 ball.type = "ball" local function removeBall(obj) obj:removeSelf() transition.to(ball, {time2000, y=screenBottom, x=150, onComplete=ballFall}) end transition.to(ball, {time=2000, y=screenBottom, x=150, onComplete=removeBall}) end ballFall() local function swipe(event) local phase=event.phase if phase == "began" then ball:setLinearVelocity(0,0) elseif phase == "moved" then elseif phase == "cancelled" or phase == "ended" then transition.cancel(action) local eventXMove = (event.xStart - event.x)\*-3 local eventYMove = (event.yStart - event.y)\*-3 ball:setLinearVelocity(eventXMove, eventYMove) end end ball:addEventListener("touch", swipe) local function ballCollision(self, event) if event.phase == "began" then if event.target.type == "ball" and event.other.type == "wall" then print("yes") end end end ball.collision = ballCollision ball:addEventListener("collision", ball)