-
Notifications
You must be signed in to change notification settings - Fork 705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moves are called twice when using multiplayer: Local()
#1091
Comments
I believe this is part of an optimistic update made by the client. You can disable moves from being made on the client: |
That seemed to do the trick. Thanks. |
If anyone wants to try out the finished version made with boardgame.io, you can check it out here: https://2048-online.io/. |
Plays great @holgersindbaek! Feel free to add it to our list of games built with boardgame.io https://boardgame.io/documentation/#/notable_projects |
I'm happy you like it @delucis 🙂. Thanks for the suggestion. I've created a pull request here: #1118. I really liked my experience with boardgame.io. I might even remake my solitaire games (https://online-solitaire.com/) with it at some point. |
I'm playing around with the framework by doing an implementation of 2048.
Everything worked great until I added
multiplayer: Local()
. If multiplayer is set to that, then all moves are called twice for some reason, which is a problem for games like 2048 where a random tile is randomly added on a move.I'm not sure if this is a feature or a bug?
I've tweaked the tictactoe-example with a
console.log
in theclicCell
move function. You can see in the example that it's being called twice: https://codesandbox.io/s/boardgame-io-forked-sbedgl?file=/src/game.js.The text was updated successfully, but these errors were encountered: