Hi,
Like in chess, I would like to have the players have their board always at the bottom of the page and with the right direction (easier to read).
So the opponent board must be at the top.
With that in mind, for example : in a chess game we can setup the board with the same layout each time : black player at the top / white at the bottom.
When we setup the view for the white player, the coordinates are right.
When we setup the view for the black player we would need to display his board at the bottom (to share the same viewpoint as the white player) and in order to do that we need to translate his coordinates.
So the board game engine has a viewpoint and I create differents transformers for the views to translate the coordinates.
What do you think ?
I saw an old (not so old) post about this problem and the answer was to not put this conversion inside game logic (I couldn't agree more) nor in the view (yeah why not ... the "view" is not aware of the viewport ... ) but we need to put this somewhere. I can create a dedicated class. But the call to it is mandatory when we receive a player action (so game.action.php) or when we send data to the view.
Any ideas to make this kind of view point engine ? or if the idea above is good enough , where do you put this kind of code inside the BGA Fwk ?
thanks a lot
Like in chess, I would like to have the players have their board always at the bottom of the page and with the right direction (easier to read).
So the opponent board must be at the top.
With that in mind, for example : in a chess game we can setup the board with the same layout each time : black player at the top / white at the bottom.
When we setup the view for the white player, the coordinates are right.
When we setup the view for the black player we would need to display his board at the bottom (to share the same viewpoint as the white player) and in order to do that we need to translate his coordinates.
So the board game engine has a viewpoint and I create differents transformers for the views to translate the coordinates.
What do you think ?
I saw an old (not so old) post about this problem and the answer was to not put this conversion inside game logic (I couldn't agree more) nor in the view (yeah why not ... the "view" is not aware of the viewport ... ) but we need to put this somewhere. I can create a dedicated class. But the call to it is mandatory when we receive a player action (so game.action.php) or when we send data to the view.
Any ideas to make this kind of view point engine ? or if the idea above is good enough , where do you put this kind of code inside the BGA Fwk ?
thanks a lot