Skip to content
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

Implementing multiplayer via websockets #3

Open
vikkio88 opened this issue Nov 5, 2018 · 0 comments
Open

Implementing multiplayer via websockets #3

vikkio88 opened this issue Nov 5, 2018 · 0 comments

Comments

@vikkio88
Copy link
Member

vikkio88 commented Nov 5, 2018

in here https://github.com/NomeTemporaneo/elime/blob/master/src/store/actions/game/index.js#L62 you can find the entrypoint of the "play a card" action.

This logic needs to be made abstract and played via websocket, so the battlefield status can be updated between two different clients in "real time".

The whole objects can be serialised and sent as json, as they do have 2 methods:
toJs => https://github.com/NomeTemporaneo/elime/blob/master/src/libs/models/battlefield.js#L184
fromJs => https://github.com/NomeTemporaneo/elime/blob/master/src/libs/models/battlefield.js#L197

the ideal workflow is:

Turn workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant