Replies: 1 comment 1 reply
-
Yes, your actor structure should be hierarchical. You can use actor registration to register actors system-wide so you can send events to them from any other actor in the system. |
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
-
Hi, fellow noob trying to use xState v5 here 👋
Simply put I have a multiplayer game that I want to create using state machines.
I have created the following machines; lobby, setup and core-game. These represent what I think our the 3 phases to a game session.
My question is should I be creating a top-level GameSession machine to encapsulate all three elements, or should I treat them as completely separate machines and communicate via subscribing to status events (e.g.
done
).My main concern with a top-level machine, is how do I communicate events to my core-game machine? Do I just forward them on from my top-level?
Basically what would be best practice in this scenario please 😄
All help is appreciated!
Beta Was this translation helpful? Give feedback.
All reactions