You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 7, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 7, 2024. It is now read-only.
Run into a problem with two or more sprites changing state simultaneously #54
https://mkoth.github.io/game-kit-example/ - here the example
repository is here - https://github.com/MKoth/game-kit-example
As you can see, after first update of state which happend each 3 sec, for both of sprites, the first spritte loosing fps to 0, while second sprite increasing it.
I guess the problem is with animation subscription in Sprite component, but it can be my bug.
Please, let me know if I'm doing something wrong.
Thank you!
In Sprite component at function componentWillReceiveProps
commented subscribu, unsubscribe to the animation function, that solved the problem for me. That definetly not the best solution. I guess the problem is the order of subscription unsubscription. First character sprite unsubscribe and trying to subscribe on state change but then, the second characrers sprite interrupt and subscribe itself 2 times leaving first character sprite possibility for subscription. Yet, sprite need to have ability to unsubscribe from animation, so my solution is not solution.
Activity
MKoth commentedon Dec 6, 2017
Find out that sometimes its working, need to refresh a couple of times, and wait 3 sec for state to change to see a bug
MKoth commentedon Dec 6, 2017
In Sprite component at function componentWillReceiveProps
commented subscribu, unsubscribe to the animation function, that solved the problem for me. That definetly not the best solution. I guess the problem is the order of subscription unsubscription. First character sprite unsubscribe and trying to subscribe on state change but then, the second characrers sprite interrupt and subscribe itself 2 times leaving first character sprite possibility for subscription. Yet, sprite need to have ability to unsubscribe from animation, so my solution is not solution.