'Connecting players' local games together
I'm looking for a special answer that i can't find anywhere and i need your help/ideas:
The situaton: I'm making a mobile web-game that is played on mobile phones. Every player has its own version and profile with levels etc. It is a roulette game so i want if a player gets a card it gets xp and the other players need to get xp as well. But as of now there is no way of syncing game data from one player to other players.
All roulette cards are stored in one big array and if a card is turned the script chooses a random one from the stack.
I was self thinking of some kind of code that everyone enters at the start of the game, and it contains the numbers of idk 20 cards in the array and so the game of all players will show the same card if they click next. But i dont know how to decode this and it is a bit irritating to enter such big code everytime you want to play.
P.s. i do not want to use a third party library or nodejs or something like that. Just javascript. The "app/game" is hosted on a website that every player loads on their own phone. And game save data is stored in localstorage.
Can you please help? I dont have code to show. That is not relevant here.
Solution 1:[1]
I fixed it. I used QR Codes instead. One qr code generator for the host and a qr code reader for the other players.
Search google for qr code reader js and you'll find it
thnx!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | BeldrNL |
