# Why is the pawn not moving?

I have a set of moving chess pieces and am now trying to implement the rules to prevent them from going anywhere. The pawns use this code to move: (Sorry for the blurriness, the IDE did it automatically when I zoomed out so I could get it all.)

When I go to move the Pawn, it won't move at all. Weirdly, when I had the if statement at the top set to true, it would work just fine, just excluding the moving double on the first move.

What is causing this problem, and how can I fix it?

It never runs the first section because when you click on the pawn the first time it changes the value of the variable before it even moves. In the second section, the mouse_y >= y && mouse_y <= (y + 64) is the 64 by 64 grid the pawn is in as its location is determined by the top left corner.
To fix this, you would make it so that it does not change until after it has moved instead of when the player clicks on it, and change the y + 64 to y + 128.