by Fuzzy » Mon Oct 22, 2007 4:13 am
Easily done!
First, you will need a step size variable. you might just choose this, or you might calculate it as a fraction of the circle. If the number is too large, it will have the circle drawn with flat faces. If its too small, you will end up calculating to often, to the detriment of your script. [edit] this should be expressed in radians. [/edit]
If the size of the circle is going to vary, then you should calculate it when you know the size of the circle.
Next you need the radius of the circle. Store in a cool dry place for now.
Take the angle of the actor from the center point(as if it were (0, 0)). if need be, store the center point in a variable and then subtract it from itself to get zero zero.
take this angle(make sure its in radians, not decimals) and do this
Make a loop from 0.0 to 1.0(I tend to use i)
in the loop, use this
Xoffset = radius*cos(angle+(stepsize*i));
Yoffset = radius*sin(angle+(stepsize*i));
END LOOP
Now add back the stored center point to the Xoffset and YOffset and you have your actors location.
thats it.
I should add that its not layed out in a GE sorta way. you would likely do this in the draw event, so your loop would simply be a counter that is from 0.0 to 1.0 wrapping around
Last edited by
Fuzzy on Thu Oct 25, 2007 8:15 pm, edited 3 times in total.
Mortal Enemy of IF....THEN(and Inspector Gadget)
Still ThreeFingerPete to tekdino