S
S
Sergey2018-05-16 17:06:33
JavaScript
Sergey, 2018-05-16 17:06:33

JS condition depending on object coordinates?

I don’t know js well, there is an animation where an object moves along a radius and stops at a certain place.
How to set a condition so that when you click on another similar object, this object continues to move in a circle and the other object also starts moving along the same radius? It turns out I need to set a condition with coordinates? It turns out that I need to create a condition, indicating the coordinates of the first object, so that the script can understand where the first object should continue its movement from? But how to arrange it? I will also be glad for any materials on this topic. Thank you.
5afc3a6e859f1845571100.jpeg
I have attached a picture to make it clearer. By clicking on object 1 - it moves along the radius and takes the place of object 3, and objects 3 and 2, respectively, move up by 1. Thus object 3 takes the place of the 2nd, and the 2nd takes the place of the first.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan, 2018-05-16
@Sect0R

Why do you need coordinates?
You can make it easier - put a mark 0 in the upper part of the circle (where the clock hand is 12) and measure the length of the segment passed by point 1.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question