Game with interaction (Active Player)

Game development with Board Game Arena Studio
Post Reply
User avatar
MGoulet
Posts: 54
Joined: 20 September 2014, 13:17

Game with interaction (Active Player)

Post 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
User avatar
Tisaac
Posts: 2743
Joined: 26 August 2014, 21:28

Re: Game with interaction (Active Player)

Post by Tisaac »

I would do 1.
User avatar
thoun
Posts: 1620
Joined: 10 December 2020, 22:25

Re: Game with interaction (Active Player)

Post by thoun »

I use solution 2 in this case, but the solution 1 works too.
User avatar
tchobello
Posts: 694
Joined: 18 March 2012, 13:19

Re: Game with interaction (Active Player)

Post by tchobello »

I would do 1 as they never play at the same time.
Post Reply

Return to “Developers”