If a message is received that has not been sent by the player himself, then it will have been sent by the opponent. In this case, the core
should:

  • determine if there waas an attack and it was a draw in which case it should clear the x1,y1 and x2,y2 squares
  • determine if the x1,y1 piece is revealed or not. According to the rules a piece can be revealed only after it has participated in a battle.
  • if not a draw then process the move by moving x1,y1 to x2,y2 and then clearing x1,y1
  • update its data structures (battlefield array)
  • draw the appropriate piece at the correct square on the board.
  • set the turn variable back to 0 to allow receiver of message to play

    It should be noted that at this stage of the game, the player need not check if the move performed is legal or not, as this has already been performed
    before the move command was sent by the player's opponent. Thus at this point, the receiver should only be concerned with updating the battlefield array
    correctly.


    Please email me if you have any questions.

    Back to the battle page
    Back to core module home page
    Back to core design page


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