hi everybody.
I have a loop that I can not stop. I would like at the end of my transition character disappears with the bridge. By cons if the bridge goes, I have to check the recurrence of my character, that’s why I use a listener.
in my code I cancel my transition works, but what happens is the command cycles …
I thought about using a timer.performwithdelay but it does not work. thank you if you can help me.
local bridge = display.newRect(200,200,300,300) bridge:setFillColor(1,0,0) bridge.xScale=1 bridge.yScale=1 local character = display.newCircle(200,200,50) character.xScale=1 character.yScale=1 transition.scaleBy(bridge, {tag=bridgefall, time=1000, yScale=-1 , xScale=-1}) local function one() print("ok") transition.cancel("fallCharacter") end local function onEveryFrame(event) print(bridge.xScale) if ( bridge.xScale \<= 0.05 ) then transition.scaleBy(character, {tag=fallCharacter, time=500, yScale=-0.15 , xScale=-0.15, onComplete=one}) end end Runtime:addEventListener("enterFrame",onEveryFrame)