I’m learning blueprints functionality and taking this tutorial as a course , so i decided to add some functionality to the game starting from the end point of this tutorial , for instance how to decide if it is black or white turn and how to go about setting the allowed moves for any piece , below my ways of doing it but i’m failing at it :
Note : the "Dark pieces " item variable (in the pictures 1, 2 ) this is an addition i created in construction script to hold all and only the Black chess pieces .
1- getting the last click color compare it to the next click color and gate the click to open only if last click color is Not equal to next click Color (see picture_1 ).
2- i tried also checking if the last click is black then setting the condition to bool variable then setting that to opposite for the next click by way " is Not bool " ( see picture _2).
There are couple of functions you need to write in order to check if it’s valid move and which players plays.
Let’s assume that you are using only one controller and single player game.
You need to have a state which turn it is -> I would introduce boolean iSWhitePlayer and change it from true/false when every move finishes.
Base on that you may allow to move white/black pieces which you simply check.
Every piece has already piece type and color.
Without highlighting possible moves it would just check if it’s valid on drag.
The easiest solution would be writing matrixes for every possible XY move.
I am having troubles when i make the chess board. it seems to be doubling up in most of the spaces. i followed the instructions but it did this when i got to about 4 mins 30 secs through the video following what it said to do