Need help with chess game

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)

Project Link: https://makecode.com/_FY4Uq1g6Ya1j

3 Likes

i think oh yeah let me call him in @Sofa has made a Chess game maybe he can help

Did Someone Summon me

1 Like

So what I used to do this was to add to my code

// 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.