Page 1 of 1

Game with interaction (Active Player)

Posted: 11 June 2023, 01:37
by MGoulet
Hi

I have a game that I need to change the current active player to let interact the opponent (depends on which card is played).

States :
A -> B -> A
(A) : MainPhase : Play a card
(B) : Need to resolve the card with a server change (ex: Draw 5 cards and discard 3, or Draw 3 cards and draw 2 more cards unless the opponent discard a card).

I think I have two options :
1. Add a global variable to remember who is the current player turn to go back to that player's turn after the opponent made is move.
- In this case, when I play the card, I need a gamestate between (A) and (B) only if I switch the current user. Same thing when reswitching between (B) to (A).
2. Use multipleactiveplayer state and only activate the opponent (or the current player). When the opponent finish his move, the game go back to the active player without the need of a global variable.


I would like to know if anyone is thinking for a third options or a best practice with the framework.

Thanks

Re: Game with interaction (Active Player)

Posted: 11 June 2023, 08:04
by Tisaac
I would do 1.

Re: Game with interaction (Active Player)

Posted: 11 June 2023, 09:52
by thoun
I use solution 2 in this case, but the solution 1 works too.

Re: Game with interaction (Active Player)

Posted: 11 June 2023, 11:45
by tchobello
I would do 1 as they never play at the same time.