I have a problem with my touch and move events for my game. It works perfectly on my Kindle Fire but when I try it on my LG Spectrum 2 phone the object that I am moving around the screen doesn’t return to it’s original always if the requirements aren’t met. Like I said it works perfectly on my Fire. Not sure why it’s not working on my Android phone. Here’s the code:
-- Start Touched Item local function itemTouched(event) print(event.target.name) print(event.target) print(event.id) print(event.target.id) local obj=event.target print(obj) if event.phase =="began" then obj.isFocus=true display.getCurrentStage():setFocus(obj) slotterX=obj.x slotterY=obj.y obj.startMoveX=obj.x obj.startMoveY=obj.y return true elseif event.phase == "moved" then obj.x=(event.x-event.xStart)+obj.startMoveX obj.y=(event.y-event.yStart)+obj.startMoveY elseif event.phase == "ended" or event.phase == "cancelled" then display.getCurrentStage ( ):setFocus(nil) obj.isFocus=false if (hasCollided(event.target,plantPot) and event.target.name == "flagon" and inven[9]=="1") then transition.to( obj,{time=2000, rotation=360,x=plantPot.x, y=plantPot.y}) display.getCurrentStage ( ):setFocus(nil) obj.isFocus=false else transition.to(obj,{time=500, x=obj.startMoveX,y=obj.startMoveY,xScale=.8,yScale=.8}) display.getCurrentStage ( ):setFocus(nil) obj.isFocus=false end return true end return false end