Board Game Experiment, with JS Prototypes and Canvas

The Rules

For those who don’t know the game we’re about to walk through, take some time to understand the rules… it’s going to be helpful I guess.

Each player in turn, chooses to move his pawn or to put up one of his fences.
When he has run out of fences, the player must move his pawn.
Pawn moves
The pawns are moved one square at a time, horizontally or vertically, forwards or backwards.
The pawns must get around the fences.
Positionning of the fences
The fences must be placed between two sets of two squares.
The fences can be used to facilitate the player’s progress or to impede that of the opponent, however, an access to the goal line must always be left open.
Face to face
When two pawns face each other one on neighbouring squares which are not separated by a fence, the player whose turn it is can jump the opponent’s pawn (and place himself behind him), thus advancing an extra square.
If there is a fence behind the said pawn, the player can place his pawn to the left or the right of the other pawn.
It is forbidden to jump more than one pawn.