hi everybody,
since 4 days, i try to find a solution…it is for game like zelda with a top view.
my character is a blue circle who is on a red bridge ( a rectangle ). The bridge falls but the character could escape and go out the bridge.
but my problem is how cancel the animation “characterFall” while my character is moving ? i have tried with flag, condition, hierarchy but without succes…
thanks a lot if you could help me
local flag = true local background = display.newRect(200,200,1000,1000) local bridge = display.newRect(200,200,200,200) bridge:setFillColor(1,0,0) bridge.xScale=1 bridge.yScale=1 local character = display.newCircle(200,200,50) character:setFillColor(0,0,1) transition.scaleBy(bridge, {tag="bridgefall", time=6000, yScale=-1 , xScale=-1}) local function myTapListener(event) characterEscape=transition.to(character, {time=6000, x=event.x, y=event.x}) flag=false return flag end background:addEventListener("tap", myTapListener ) local function onEveryFrame(event) print(bridge.xScale) if ( bridge.xScale \<= 0.9 ) then if ( flag == true ) then fall=transition.scaleBy(character, {tag="fallCharacter", yScale=-1 , xScale=-1, time=6000}) flag = false end end end Runtime:addEventListener("enterFrame",onEveryFrame)