Replies: 2 comments 3 replies
-
@bigtimebuddy I tried to take your code (I got to learn just from viewing it) but I still can't get it to work. |
Beta Was this translation helpful? Give feedback.
2 replies
-
Anyone? @bigtimebuddy? Apologies for tag-spamming in so many places! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Migrated from
#7136
Expected Behavior
Player walking animation as in:
This.is.Mario50.2021-01-10.17-00-00.mp4
Current Behavior
Player switching animations but not changing frames in:
screen-recorder-sun-jan-10-2021-17-00-57.mp4
Often, if I change the frame using
gotoAndPlay()
, the frame is set to this index in spite of emptying the cache while refreshing.This.is.Mario50.and.11.more.pages.-.Personal.-.Microsoft.Edge.2021-01-11.12-38-14.mp4
My code:
https://gitlab.com/Vivraan/mario50-pixijs/-/blob/227a18672242d9c468274e6a50c53cff1adda7f2/player.js#L63-73
Steps to Reproduce
The commit I'm working from is this one, which summarises the repro steps.
Replies from Issues thread
@bigtimebuddy says:
I think your logic for move incorrectly calls every frame. This mean that it's constantly setting textures on your animation frame after frame. If you cache the previous direction to only handle changes, it's better.
Here's an isolated example (click on the character on the right and then use the left and right arrow keys to see the animation switch). https://jsfiddle.net/bigtimebuddy/qo12kdnj/
This is not a limitation of the AnimatedSprite. In your case, this is an appropriate use.
Beta Was this translation helpful? Give feedback.
All reactions