Closed Starlight-30036225 closed 7 months ago
I will start looking at this now...
wish me so much luck
I want the board to handle all of this internally, so the server and the other board should not have any difference if the board is flipped or not. Which means all communications inward and outward will need to be flipped.
This will be interesting...
The first, and easiest thing to do is just visually change the board by flipping the notation. This works really nicely as it can be read both ways easily. This can be done in one line at the start of the 'LoadMapFromNotation' function
So now, when the player is white:
And when they are black:
Deceptively, Right now it will work as expected because the board is the same on both sides. But currently, information send to the server and recieved will be the wrong way round. So I am likely going to need a function that flips X and Y variables. I think this will use mod, but ill have to do some tests
I think this will work, but its going to be a tricky thing to test...
hmmmmmmm
I dont know if this is better?
Much better
Updated the function, and after a lot of tweeks this works.
To update moves as they are received I added another new function:
Nice and simple
Only took me 45 minutes...
Only thing left is the ranks and files should(?) be easy...
took some tinkering to get the numbers perfect but this looks right?
I am very proud of this, time to close the issue.
I need to create a way for the board to be drawn backwards for players who are playing black to make it clear which side they are on. However this is going to mean a lot of gutting my current display code to make it able to be flipped