2 Tweens at once?

  • Hi Guys, I am trying to have a arrow pointing at an object and it cycles back and forth. So far so good, but at the same time I would like the scale of the arrow to change to give it more of a squishy feel.

    Thanks Lee

    	var arrow:FlxSprite = new FlxSprite(670,200);
    	arrow.scale.y*= -1;
    	FlxTween.tween(arrow, { x: 670, y: 150 }, .3, { type: FlxTween.PINGPONG, ease: FlxEase.quadInOut, onComplete: changeColor, startDelay: 0, loopDelay: 0 });	

    // need another tween to run at the same time as the tween above to effect scale. ???

  • If you want to scale an object with tween you can do it like this:

    // Scaling an object with tween.
    FlxTween.tween( anyFlxSprite.scale, { x:2, y:2 }, 2);  // It makes object's scale.x and scale.y values => 2, in 2 seconds.                       

  • Ahh nice, so you can put this one after another and they work together. Perfect . Thanks for that. Lee

Log in to reply

Looks like your connection to HaxeFlixel was lost, please wait while we try to reconnect.