Is there a way to mirror an object ( object:scale(-1, 1) like so) while using a transition.to() event if transition event.x > object.x?
Here is my code:
local function flip( event ) if tween1.parmas.x \> angry.x then angry:scale(-1, 1); -- Mirror elseif tween1.x \< angry.x or tween2.x == angry.x then angry:scale(1, 1); -- Mirror end end local function flip2( event ) if tween2.x \> angry.x then angry:scale(-1, 1); -- Mirror elseif tween2.x \< angry.x or tween2.x == angry.x then angry:scale(1, 1); -- Mirror end end local function moveAngry() local tween1 = transition.to(angry, {time=1250, delay = 1, x=math.random(20,440), y=math.random(20,270), onStart = flip, onComplete=moveAngry}) local tween2 = transition.to(angry2, {time=1250, delay = 1, x=math.random(20,440), y=math.random(20,270), onStart = flip2 }) end moveAngry()
This will make it some my object, angry, will flip if the transition event.x is less than the current x position. If this can not be done, does anyone have a work around?
Thanks
Sam