phaser-ce icon indicating copy to clipboard operation
phaser-ce copied to clipboard

Repeat tween from shows error

Open omretterry opened this issue 6 years ago • 4 comments

  • A bug in the API:
    • Phaser version(s):2.10.3
    • Live example:Codepen
    • What should happen:The sprite goes from (100,0) to (0,0) twice.
    • What happens instead:The sprite goes to (0,0) to (100,0) twice.

The origin position of sprite is (0,0),then i use tween from (100,0).First time it runs right,but repeat animation is 'tween to' instead of 'tween from'

omretterry avatar Apr 26 '18 02:04 omretterry

Thks reply.But i am still confused.In your code,The animation is from x:0 to x:400.Why the repeat change the start and end,from x:400 to x:0?

omretterry avatar Apr 27 '18 02:04 omretterry

TweenData#start swaps the start and end values. I'm not sure why yet.

For now try to use Tween#to instead if you want to use repeats.

samme avatar Apr 27 '18 02:04 samme

Uh...You mean use Tween#to? I use Tween#from just like from x:0 to x:400 in demo it always reserve the path in repeat. I just want to make the sprite always move from x:0 to x:400.But i dont know how to make it works with Tween#from. :(

omretterry avatar Apr 27 '18 03:04 omretterry