emilbratt/lonely-chess

Track which player's turn it currently is

Opened this issue · 1 comments

On top of the missing functionality to move pieces (#10), there is also no logic to keep track of which player's turn it currently is

Great issue, Torje!

I can see this being solved in many ways.
For example just by including a new variable for this.

In the long run, maybe a solution could be that we add a new script file "'movement.js" etc..
That file could store all previous moves as well as who's turn it is?

Tracking all moves would also help determining whether or not an "En passant"-attack-move is available for a pawn.
The reason I think, is because it depends entirely on the opponents last move being a pawn move and where it moved.