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.
Sorry I’m not good at blocks. When I first did coding I started with JavaScript because I was advanced in code. So sorry. But I can put that code into blocks if you need it.
the Math.abs is the absolute(number) blockthe Piece.Type.None seems to be a enum (the drop-down list) I’m not sure if that’s possible in blocks if and else if are the logic blocks the dy,dir,dx,fy,startRow etc look to be variables the / is the math block with (number) drop-down Menu(/) (number)