I need some help with my chess game, it’s been in development for about 3 months now. I’ve challenged myself to not use a SINGLE extension! I’ve run into an issue, where, no matter what I do, none of the pawns say they can take, even though they can. I even switched the “cantake” variable to false to see if that’ll fix it, but nothing changed, can anyone help? (Also, this post is the 4000th post with the “game” tag)
// Normal move
if (dx == 0) {
if (dy == dir && target.type == PieceType.None) valid = true;
else if (fy == startRow && dy == 2 \* dir && target.type == PieceType.None && board\[fx\]\[fy + dir\].type == PieceType.None) valid = true;
}
// Capture
else if (Math.abs(dx) == 1 && dy == dir) {
if (target.side != Side.None && target.side != p.side) valid = true;
// En Passant check
else if (tx === lastPawnDoubleMoveX && ty === lastPawnDoubleMoveY) valid = true;
Sorry about all the spaces. I also see you cant Select black peices. (unless your adding some code where an Ai can play) So you can sort out your code and I really don’t mind if you add that code that I pasted in from my code. If that doesn’t work just tell me and I’ll give you a rundown.