Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeat tween from shows error #529

Open
omretterry opened this issue Apr 26, 2018 · 4 comments
Open

Repeat tween from shows error #529

omretterry opened this issue Apr 26, 2018 · 4 comments

Comments

@omretterry
Copy link

omretterry commented Apr 26, 2018

  • 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'

@samme
Copy link
Collaborator

samme commented Apr 26, 2018

@omretterry
Copy link
Author

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?

@samme
Copy link
Collaborator

samme commented Apr 27, 2018

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.

@omretterry
Copy link
Author

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. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants