bacteriaman
Member
I have a bunch of objects in a circle, like the twelve hours on a clock. The actual number of objects will vary depending on the game condition from moment to moment. Objects will be continually created and added to the circle. Likewise objects will be continually removed. The circle size will dynamically expand and retract so the current number of objects are always evenly spaced apart without touching each other.
When pressing the mouse pointer on one object and dragging, the object will follow the mouse in a circular pattern using lengthdir_x and lengthdir_y to maintain a consistent distance from the center coordinates.
I need a method to synchronize the rotation all of the other objects in the circle. I have previously accomplished a similar requirement by using a parent object to adjust the relative angle of each child object. However in this case all of the objects are peers and none are permanent.
After giving this challenge some thought, one possible approach is to create an invisible "master" object with a circular sprite large enough to encompass the maximum number of "slave" objects. So when dragging a slave object, you would actually be dragging the master object and all of the slave object angles would be adjusted accordingly.
Question: Is this a sound and reasonable approach or is there a better and simpler way to go about it?
All comments/suggestions appreciated.
When pressing the mouse pointer on one object and dragging, the object will follow the mouse in a circular pattern using lengthdir_x and lengthdir_y to maintain a consistent distance from the center coordinates.
I need a method to synchronize the rotation all of the other objects in the circle. I have previously accomplished a similar requirement by using a parent object to adjust the relative angle of each child object. However in this case all of the objects are peers and none are permanent.
After giving this challenge some thought, one possible approach is to create an invisible "master" object with a circular sprite large enough to encompass the maximum number of "slave" objects. So when dragging a slave object, you would actually be dragging the master object and all of the slave object angles would be adjusted accordingly.
Question: Is this a sound and reasonable approach or is there a better and simpler way to go about it?
All comments/suggestions appreciated.