I want to move one object (dot) in a circular path. How should I change the X and Y coordinates to accomplish this?
Tell me more
×
Game Development Stack Exchange is a question and answer site for
professional and independent game developers. It's 100% free, no registration required.
|
|
You can make it by using simple math.
Origin is the center of your circle. Size is the radius of that circle. Thats it. |
|||
|
|
|
There's another trick, where you use the sin(x+a) and cos(x+a) formulas, and that allows you to compute sin(a) and cos(a) -- a being the angle by which you want to move from your current position -- only once and do simply multiplication and additions at each step. sin(x+a) = sin(x)*cos(a) + cos(x)*sin(a), iirc. Of course, that assumes constant angular velocity. |
|||
|
|
