I am making a ludo game. The gameboard is made out of two arrays, one for x values and one for y values (playerxPos and PlayeryPos). They “depend” on the variable currentPos. When currentPos = 1 playerxPos[currentPos] = 587. The outer “circle” is 40 blocks long and when a player has moved a lap around the entire thing it should restart from 0 so it can continue as all colors use the same array, but my way doesn’t seem to work and I have no clue why. It works if you just roll 1s all the way around, but as soon as you roll anything else the player is moved to the top left corner (0,0) after passing square 40 instead. If I then click on the player again, it moves to the correct square. Why doesn’t my current code work and how can I make it work?