Hi all,
I am trying to develop a game of token movement on a board. At one moment, I am checking possible movements on the client side, beacuse everytime the player selects a token, I want to show the possible moves that tokes has, without changing the state of the game. Each player has 8 tokens at the beggining, so they may select several of them to see their possible movements before deciding the actual movement to make.
How can I update the value of this.gamedatas where the board state is stored? On the "yourgamename.js" explanation it says:
"this.gamedatas
Contains your initial set of datas to init the game, created at game start or game refresh (F5)
You can update it as needed to keep an up to date reference of the game on the client side if you need it (most of the time you don't). "
But it does not say how.
I am also wondering if I should be doing the checking of possible moves on the server side, but is it possible to do it without changing the state of the game?
Thanks in advance for your help.
I am trying to develop a game of token movement on a board. At one moment, I am checking possible movements on the client side, beacuse everytime the player selects a token, I want to show the possible moves that tokes has, without changing the state of the game. Each player has 8 tokens at the beggining, so they may select several of them to see their possible movements before deciding the actual movement to make.
How can I update the value of this.gamedatas where the board state is stored? On the "yourgamename.js" explanation it says:
"this.gamedatas
Contains your initial set of datas to init the game, created at game start or game refresh (F5)
You can update it as needed to keep an up to date reference of the game on the client side if you need it (most of the time you don't). "
But it does not say how.
I am also wondering if I should be doing the checking of possible moves on the server side, but is it possible to do it without changing the state of the game?
Thanks in advance for your help.