Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.
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

Open

Description

@MKoth

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!

Activity

  1. MKoth commented on Dec 6, 2017

    @MKoth
    Author

    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

  2. MKoth commented on Dec 6, 2017

    @MKoth
    Author

    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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions