How to store the path of a game pawn in a turn based game ?
Posted
by panzerschreck
on Stack Overflow
See other posts from Stack Overflow
or by panzerschreck
Published on 2010-05-22T00:17:23Z
Indexed on
2010/05/22
0:20 UTC
Read the original article
Hit count: 533
Hello,
I have a square grid, for a turn based game ( grid is similar to the chess board ), but the moves in the games are different based on whether you have lapped your opponent pawn at least once or not.
i.e if you have not lapped (beaten any of the opponents pawns) in the outer most grid as below
if you have lapped your opponent pawn once at least, then you get to reach home,this way.Any player having all his pawns reaching "home" first wins.
The ones in yellow are safe-houses, i.e both the opponent pawn and the player's pawn get to stay in the same grid, this is not considered to be lapping ( the opponent ).The lapped pawn will return to its start point.
Now the question is, what is the effective way to store the paths for the all the pawns.we will have 4 pawns for the player and 4 opponent pawns.
Is there any pattern to store such static information, in a elegant way ?
Thanks for your time
© Stack Overflow or respective owner