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?