adjusting the amount of animations (motion path) to left or right percisely not manually?

May 31, 2023

I am planning to make a snake and ladder program with a hundred houses. For the object, I have planned to move to the right, left and up by one house(animations..direction=none.....relative start point). Depending on the number that each dice brings, this movement in one house will turn into a movement in several houses. Because the adjustment of these movements is manual, if it deviates slightly up or down, after ten or twenty movements, the amount of this deviation will increase and the nut will come out of its house. How can you be sure that the movement adjustment is the same amount to the left as it is to the right, so that the imbalance does not cause a large amount of deviation after ten or twenty moves?

16 Replies
Phil Mayor

I am not sure the board is distributed vertically and horizontally, it should be simple to create the paths, if you get up and down working as relative paths and I would set the ladders and snakes as normal paths so they align directly with centres. There is often a 1 pixel drift, I often use a non relative path to fix the drift.

 

Jose Tansengco

Hi Mah, 

Thanks for sharing a copy of your project file. I took a look at it and saw that the endpoints of some of the animations weren't directly centered, which might explain the deviation your objects are experiencing. 

It might take some trial and error to correct, but you'll want to make sure that the game piece lands dead center on the squares each time, otherwise the position of the object will start to deviate the more it moves up the board.

mah bag


Hello and thank you. I have drawn the houses crookedly, but even if I draw regularly, this deviation occurs, even if you make these settings, deviation occurs The smallest deviation will become a large amount after a hundred houses.These deviations can be neglected in snake and ladders with few houses and large dimensions of the houses, but in snake and ladders with many houses and small size, these deviations appear soon.Note that in the snake and ladder of a hundred houses, due to the existence of the snake, the player may travel a thousand houses to reach the last house. solution can be to set the x and y of the bead in each house, which is a difficult task and I don't know the javascript code for setting the x and y of an object.Another way is to use states, which can no longer see the gentle and soft movement , and the movement is instantaneous and jerky.

mah bag

At first, I used a table of ten by ten houses,but the problem still remains. Then I made a square and copied and  pasted it and made other squares and put them together, but the problem still remains and I had to put the squares a little crooked, but the problem still remains. 

mah bag