Do transition.to just by using tag parameter

So I have a transition:

transition.to(obj1, {time=math.random(2000,5000),x=obj2.x-50,y=obj2.y-50,transition=easing.inOutBounce, tag="goingtoObj2"})

If I want to repeat the same transition, can I do reference it by something like:

transition.to(obj, {tag="goingtoObj2"})

I know I can just copy and paste the code but is there any other way of referencing it?

You could easily write your own function that takes in an object and either applies these specific parameters or parameters from a table in a transition.to on the object.

This would fit the DRY (Don’t repeat yourself) principle - if you ever find yourself copying and pasting code, write a function.

Ah yah thats what I thought.

Thanks!

You could easily write your own function that takes in an object and either applies these specific parameters or parameters from a table in a transition.to on the object.

This would fit the DRY (Don’t repeat yourself) principle - if you ever find yourself copying and pasting code, write a function.

Ah yah thats what I thought.

Thanks!