Skip to main content
Post Undeleted by Zetsu_Zetsu
Post Deleted by Zetsu_Zetsu
added 487 characters in body
Source Link

I am creating a Yugioh java game with MVC. I was wondering wich is the better way to manage game states with MVC? I tought maybe I can use State Pattern in Model section with DrawPhase, InvocationPhase and BattlePhase as states, but in this way I won't know wich player has invoked a card or do something. Is there another way that allow me to know the whole game state and have control over the turns?
Also I'm not sure about using Threads with a Computer bot to play with so the idea of a game loop is almost discarded.

This Yugioh game is a little more simple:

On each turn you:

-Pick a card from your Deck and add it to your Hand

-Invoke monsters and spells to the board

-Battle Phase: atack to the opponent with your monsters that are in the board or use your spells that are in the board to: damage the opponent, gain life points, increase damage of monsters, etc. Monsters that fight can die and go to the gaveyard. (each player has a gaveyard)

-Next turn and repeat.

I am creating a Yugioh java game with MVC. I was wondering wich is the better way to manage game states with MVC? I tought maybe I can use State Pattern in Model section with DrawPhase, InvocationPhase and BattlePhase as states, but in this way I won't know wich player has invoked a card or do something. Is there another way that allow me to know the whole game state and have control over the turns?
Also I'm not sure about using Threads with a Computer bot to play with so the idea of a game loop is almost discarded.

I am creating a Yugioh java game with MVC. I was wondering wich is the better way to manage game states with MVC? I tought maybe I can use State Pattern in Model section with DrawPhase, InvocationPhase and BattlePhase as states, but in this way I won't know wich player has invoked a card or do something. Is there another way that allow me to know the whole game state and have control over the turns?
Also I'm not sure about using Threads with a Computer bot to play with so the idea of a game loop is almost discarded.

This Yugioh game is a little more simple:

On each turn you:

-Pick a card from your Deck and add it to your Hand

-Invoke monsters and spells to the board

-Battle Phase: atack to the opponent with your monsters that are in the board or use your spells that are in the board to: damage the opponent, gain life points, increase damage of monsters, etc. Monsters that fight can die and go to the gaveyard. (each player has a gaveyard)

-Next turn and repeat.

Source Link

Manage game states of a card game with MVC

I am creating a Yugioh java game with MVC. I was wondering wich is the better way to manage game states with MVC? I tought maybe I can use State Pattern in Model section with DrawPhase, InvocationPhase and BattlePhase as states, but in this way I won't know wich player has invoked a card or do something. Is there another way that allow me to know the whole game state and have control over the turns?
Also I'm not sure about using Threads with a Computer bot to play with so the idea of a game loop is almost discarded.