I have a function that’s called onPress, that sends boxes to a specific location.
I’m using tween class- anyway what is the ideal way to truncate this code?
Could I use a loop and just replace the numbers (1, 2, 3) with “i”?
If so could someone show m an example?
Thanks in advance!
function mover (box1X, box1Y, box2X, box2Y, box3X, box3Y) {
box1rotateMe.continueTo (0, tweenSpeed);
box1scaleMeX.continueTo (100, tweenSpeed);
box1scaleMeY.continueTo (100, tweenSpeed);
box1locationX.continueTo (box1X, tweenSpeed);
box1locationY.continueTo (box1Y, tweenSpeed);
//
box2rotateMe.continueTo (0, tweenSpeed);
box2scaleMeX.continueTo (100, tweenSpeed);
box2scaleMeY.continueTo (100, tweenSpeed);
box2locationX.continueTo (box2X, tweenSpeed);
box2locationY.continueTo (box2Y, tweenSpeed);
//
box3rotateMe.continueTo (0, tweenSpeed);
box3scaleMeX.continueTo (100, tweenSpeed);
box3scaleMeY.continueTo (100, tweenSpeed);
box3locationX.continueTo (box3X, tweenSpeed);
box3locationY.continueTo (box3Y, tweenSpeed);
}