\_W = display.contentWidth \_H = display.contentHeight local player = display.newRect(0,100,50,50) transition.to(player,{time = 8000,x = \_W+40, y=player.y + 400}) local function move() player.y = player.y - 3 end local function onTouch(e) if e.phase == "began" then Runtime:addEventListener("enterFrame",move) elseif e.phase == "ended" then Runtime:removeEventListener("enterFrame",move) end end Runtime:addEventListener("touch",onTouch)
How to make the object move up when I touch the screen ? Can I use the enterFrame and transition.to() together ?