Not know js, there is an animation where the object moves along the radius and stops at a certain place.

How to set the condition that when you click on another similar object, the object continued moving in a circle and another object began to move on the same radius? It turns out I need to set a condition with the coordinates? It turns out that I need to create a condition indicating the coordinates of the first object, the script could figure out where the first object should continue its movement? But how does it apply? Also I will be happy for any material on this topic. Thank you.

Attached a picture to make it clearer. By clicking on the object 1 - it moves radially and comes to place the object 3 and objects 2 and 3 respectively are shifted by 1 up. Thus, the object 3 takes place the 2nd and the 2nd gets in the first place.

How to set the condition that when you click on another similar object, the object continued moving in a circle and another object began to move on the same radius? It turns out I need to set a condition with the coordinates? It turns out that I need to create a condition indicating the coordinates of the first object, the script could figure out where the first object should continue its movement? But how does it apply? Also I will be happy for any material on this topic. Thank you.

Attached a picture to make it clearer. By clicking on the object 1 - it moves radially and comes to place the object 3 and objects 2 and 3 respectively are shifted by 1 up. Thus, the object 3 takes place the 2nd and the 2nd gets in the first place.

asked June 5th 19 at 21:44

1 answer

answered on June 5th 19 at 21:46

Why do you need coordinates?

You can make it easier - to put a mark of 0 at the top of the circle (where the clock hand on 12) and to measure a length of the segment traversed by the point 1.

You can make it easier - to put a mark of 0 at the top of the circle (where the clock hand on 12) and to measure a length of the segment traversed by the point 1.

Find more questions by tags AnimationJavaScriptjQuery

Also remember which segment (available in px) has passed each point.

You can also get the coordinates of a point knowing the radius of the circle and angle - Yvette_Sau commented on June 5th 19 at 21:52