Skip to main content
Commonmark migration
Source Link

A turn based game is going to be governed by a [state machine][1]state machine. Basically, you would lay out a series of states that can occur in a logical order.

At a high level, a player's turn could be the start of a new state, followed by all the possible actions that are allowed during that turn.

For instance

  • State - change player
    • it is now player 1's turn
  • Actions allowed
    • attack
      • select enemy to attack
    • defend
      • select unit to defend
    • move unit
      • select unit to move
      • check to ensure movement is allowed
    • etc

Obviously this will balloon quite quickly, as I've only sketched out an extremely limited plan. Having a good grasp on possible states early on will mean that you should be in a good position to implement. I'd highly stress sketching out exactly how you want the game to run....a good turn-based game requires a lot of planning IMO. [1]: http://en.wikipedia.org/wiki/State_machine

A turn based game is going to be governed by a [state machine][1]. Basically, you would lay out a series of states that can occur in a logical order.

At a high level, a player's turn could be the start of a new state, followed by all the possible actions that are allowed during that turn.

For instance

  • State - change player
    • it is now player 1's turn
  • Actions allowed
    • attack
      • select enemy to attack
    • defend
      • select unit to defend
    • move unit
      • select unit to move
      • check to ensure movement is allowed
    • etc

Obviously this will balloon quite quickly, as I've only sketched out an extremely limited plan. Having a good grasp on possible states early on will mean that you should be in a good position to implement. I'd highly stress sketching out exactly how you want the game to run....a good turn-based game requires a lot of planning IMO. [1]: http://en.wikipedia.org/wiki/State_machine

A turn based game is going to be governed by a state machine. Basically, you would lay out a series of states that can occur in a logical order.

At a high level, a player's turn could be the start of a new state, followed by all the possible actions that are allowed during that turn.

For instance

  • State - change player
    • it is now player 1's turn
  • Actions allowed
    • attack
      • select enemy to attack
    • defend
      • select unit to defend
    • move unit
      • select unit to move
      • check to ensure movement is allowed
    • etc

Obviously this will balloon quite quickly, as I've only sketched out an extremely limited plan. Having a good grasp on possible states early on will mean that you should be in a good position to implement. I'd highly stress sketching out exactly how you want the game to run....a good turn-based game requires a lot of planning IMO.

Source Link
erik
  • 1.4k
  • 3
  • 13
  • 25

A turn based game is going to be governed by a [state machine][1]. Basically, you would lay out a series of states that can occur in a logical order.

At a high level, a player's turn could be the start of a new state, followed by all the possible actions that are allowed during that turn.

For instance

  • State - change player
    • it is now player 1's turn
  • Actions allowed
    • attack
      • select enemy to attack
    • defend
      • select unit to defend
    • move unit
      • select unit to move
      • check to ensure movement is allowed
    • etc

Obviously this will balloon quite quickly, as I've only sketched out an extremely limited plan. Having a good grasp on possible states early on will mean that you should be in a good position to implement. I'd highly stress sketching out exactly how you want the game to run....a good turn-based game requires a lot of planning IMO. [1]: http://en.wikipedia.org/wiki/State_machine