The battle phase of the game is the stage at which the players make their movements and attacks.
At this stage the player uses the bottom part of the screen (what was the part used by the initialisation
phase) for message displaying and for the buttons. He is allowed to move pieces that are on the battlefield.

Movements and attacks made are relative to the rules of Stratego as explained in the rules section.
As described in the to do section some rules are still to be implemented.

To fully comprehend the battle phase it is recommended to have knowledge of the rules.


Data Structures


The basic data structure containing all information needed during this phase is:

battlefield_piece battlefield[BATTLEFIELD_DIMENSIONS][BATTLEFIELD_DIMENSIONS] where BATTLEFIELD_DIMENSIONS = 10

A 10x10 dimensional array is used throughout the battle phase. The dimensions of this array are closely related
to the board squares of the screen. Therefore, its dimensions represent the 10 rows of the screen,
where the players pieces are placed.

The elements of the array fully analysed are:
  • int player : Player identification
  • String name : Piece name i.e. Marshal, General, Bomb ...
  • int rank : The rank of every piece identified by its name
  • int revealed : A field describing if the piece being referenced has been revealed or not i.e. if it can be shown to the opponent.

    Each element of the array is associated with a piece and contains the information needed to define it and check
    what piece is the one that was clicked by the player and consequently check the legality of the move.
    For reasons of clarity, the numbering of the array corresponds to the numbering on the screen.
    For example, battlefield[2][1] corresponds to the square x=2, y=1 on the screen.

    ACTIONS

    When initialising the array all pieces are set to empty. It is during the initialisation phase that the battlefield array starts
    to get occupied. Thus when the battle phase commences the array is filled and the screen is full apart from two rows in the middle.

    When a button command is received it is processed in the same way that it was processed during the initialisation phase. PLease refer to
    that page for more information on the button command.

    Upon receiving a move command from the Input module, it is important to know who received the command. This could be the player that sent it
    (indicating that he moved a piece),the opponent or the observer. The reason for knowing this is because the actions performed in each case are different.
    It should be noted that the observer is passive when teh game is being played. He can only receive command but not generate any.

    These three divisions will be the way we analyse the design of the battle phase of the game. Please choose one of the options below:

  • player
  • opponent
  • observer


    In addition please note, that the implementation part of this project, with detailed explanation of each function is available
    at the email me if you have any questions.

    Back to initialisation phase
    Back to core module home page
    Back to core design page


    Copyright © 2002 Spyros Lambrinidis
    Last Updated 16/03/02