I’m trying to make a game similar to chess, and it to force the player to move a piece. For example, if your click on a piece, and it didn’t change position, it’s still your turn. If it does move, it’s the other players turn.
The problem is that in the first round, it works, if you don’t change position, it is still your turn. However, when it’s your turn again, and you haven’t moved the piece onto a different spot, it’s still your turn. Which is confusing because I made so it is either equal or not equal.
IDK what you are exactly aiming for but it would be logical to have boolean variable
BUT depending on what you are doing
Maybe it would be better to have number variable
The way i am taking turns is adding 1 to some number variable
And so when it is 0 its your move
After you make move
So in event where you actually clicked on your pieces it also adds 1 to that number variable so it becomes 1
This is kinda bufor phase for pieces to expand and claim others if any reached 4 dots
When they expand i also reset some timer and when that timer runs out it add 1 to that number variable and it becomes 2
And now its AI or player 2 turn
And same logic here after player or AI picks its own piece it is adding 1 to that number variable so it becomes 3
And after timer runs out so no expanding is going on it adds 1 to it again
And i check if it is 4 and if so i set it back to 0 so it is back to your turn
And so go on
So bottom line either you go with boolean or number var
But idea is to place action where you add 1 to variable (or toggle it if it is boolean) WHEN move is made
So in your case (i do not understand much from your events) you do not change that var when you release mouse button
But when a move is made
And how you did it in your game only you know
So you simply need to put that action into event where actual move is made and not where something is clicked
I’m aiming it to be similar to how chess pieces move. Like it you click on a object, you are able to move it. So you have to click a spot thats available to move. But the issue is that if you click on the piece again, so you have now click on the piece itself twice, it changes to the other players turn. And I want it to stay the players turn UNTIL they move the piece to a different tile. I just don’t know how to make the logic check if it moved or not.