Trying to figure out a Chess/Checker game movement issue. While I have seen this question before, the discussions either provided no answer, or the answer was no longer available (youtube videos had been taken down).
The issues is that while I can select a specific instance of the sprite, and show possible moves; when I click which location it moves the wrong instance of the sprite.
Current File
TL;DR Fix -
Explanation: Ah, the code was a bit of a confusing, un-figured-out mess, but I believe I’ve figured it out. The problem was in the use of “toggle the boolean valuable” when you clicked on the green circle. What happens is that the very first one (on the left) was selected, and so that one’s bool got toggled. Because of that, GDevelop had to choose between two objects that fulfilled the conditions, and for whatever reason it preferred the right. Then because of the very first event in the big tree, it toggled off! Leaving the one on the right still selected. Bleugh! What a mess!
I’d advise you to use “set boolean to true/false” rather than “toggle”.
Toodles!
go figure. I had moved it there because it was not toggling properly.
As for my choice of actions…After 5 yrs of writing code I have a hard time letting go of “toggle Boolean”.
Now to get it to understand the piece moved so that it does not prep for additional move…
I figure. It’s tough getting used to something when it’s all dumped on you, and you only have a vague idea of what everything does. A sort of “Yes, but what does it do exactly…”
But if you’re asking to make it so that the piece becomes unselected after pressing the green circle, I just deleted the “toggle boolean” that I’d moved in the previous post. Seems to work for me.
Thanks for the advise! Was able to get it working as desired, and now the project is progressing!