Hi Guys
I have a platform in a game that I want to move up and down. I have the following code: -
local transitionListener2 = function( obj )
if obj.transitionRepeat == “1” then
transition.to( obj, { time=tonumber(obj.transitionTime), y=tonumber(obj.y + obj.transitionY), x=tonumber(obj.x+obj.transitionX), onComplete=transitionListener } )
end
end
local transitionListener = function( obj )
if obj.transitionRepeat == “1” then
transition.to( obj, { time=tonumber(obj.transitionTime), y=tonumber(obj.y - obj.transitionY), x=tonumber(obj.x-obj.transitionX), onComplete=transitionListener2 } )
end
end
transition.to( ledge[j], { time=tonumber(ledge[j].transitionTime), y=tonumber(ledge[j].y + ledge[j].transitionY), x=tonumber(ledge[j].x + ledge[j].transitionX), onComplete=transitionListener
This works fine for the first movement and the second and the third. But on transitionListener2 I am referencing a function onComplete which is below this call. This appears to stop the process in its tracks as it cannot see the function call.
Is there a way in LUA to make sure that functions references above in code can be made visible?
