Hi, I have a function to create one set of dots, which are individually created by ellipse() function. I hope to move one set (=individual dots within the set) right and left according to the frame rate, and each set moves at its own pace.
I’m thinking of storing positions of individual dots (that would be many dots though!) and then within draw(), calling another function to increment and decrement the x and y of each dot within a set and update the ellipses to make a moving effect.
Could anyone think of a more efficient way to do this?
If you want a simple and effective way to move clusters of circles (that stay fixed relative to themselves), you can create choose a center of the cluster and the positions of the circles are relative to it. You can move the circles while moving the center.
You can use cartesian/polar coordinates. Polar would be best if you want to move the circles towards/around the center of the cluster in circular pattern, while cartesian would be best if you want them to move up/down/left/right from their position.
Now for the movement of the cluster. It is nothing difficult, you can just create a class that represents a cluster and move it in any way you want.
I am not 100% sure this is what you wanted, so yeah…
In any case, good luck with your coding!