Binding problems, property not updating
Hi, im currently creating a snakes and ladders game where the user get to roll a dice and then move a gamepiece by it self on a board with numbered squares. The other player is a CPU and rolls the dice and moves automatically when its the CPUs turn. When landing on a ladder the player goes up to a new square, and on an snake it goes down. But i also want to implement a certain feature where if you land on a certain tile in the gameboard you swap positions with the other player. This is now only working for the cpu, and the cpu lands on the other humanplayer but the humanplayer still stands on the same tile and doesnt automatically goes to the cpus tile. I feel like it is a binding problem but don't really understand it since it works for the CPU and have implemented the same sort of code. Please Help!!
3 Replies
BlazeBin - tadazmswsqrf
A tool for sharing your source code with the world!
Hi,
The following can help solving the issue.
Put some breakpoints in the swap and check the values.
of which swaps are done and if the right objects are selected.
i'd presume it's because you set the cpu's position before the player's position, and used the cpu's current position and the player's new position, rather than the cpu's old position
though i don't know where the logic for that is in your code
The logic is here, right?
Seems like you accidentally set both to the human player, when the first should be Player2