Skip to content

xstate in game dev #1694

Answered by Andarist
Handzo asked this question in Q&A
Dec 6, 2020 · 1 comments · 10 replies
Discussion options

You must be logged in to vote

Does xstate suites for my goals?

Yes, XState can be used to design games - we know several ppl using it this way.

How should I change machine configs?

I dont understand your question - this is specific to the project you are working on.

How can I send 'START' event and other ones out of Game class?

A machine in XState is like a template for a running services. You could compare it to being a class and to make its instances you can use the interpret API which will return an Interpreter instance to u which has a send method. Its possible to use transition method of the Machine but its a pure function so no actions etc will be fired and u would end up reimplementing the interpreter

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@Handzo
Comment options

@Handzo
Comment options

@Handzo
Comment options

@davidkpiano
Comment options

@Handzo
Comment options

Answer selected by Handzo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants