Click to See Complete Forum and Search --> : Smooth motion

04-26-2002, 09:40 AM
Okay say i have an "orb" that seeks something, i would rather have it go in a curved motion rather than a strait path toward it, I am not quite sure of the exact coding, but i know it would be something like this...

this._x += Math.sin(_x - objectToBeSeeked._x/180);
this._y += Math.sin(_y - objectToBeSeeked._y/180);

I know somewhere in there I need to have Math.PI and maybe i need cosine, but I am not the greatest in Trig(i haven't done any radian conversions for almost 2 years now) but ahh I am sure you guys in here just laugh at this kind of Question... well thx for reading!


[Edited by Zakarus2001 on 04-26-2002 at 11:38 AM]

04-26-2002, 11:47 AM
you have your basic easing equation to go straight towards a target:


5 being an arbitrary number to control speed.

try using different numbers for the x and y components. instead of 5 and 5, try 2 and 10.

04-26-2002, 02:56 PM
I guess i was making that a bit too hard, lol well thx and thx again...:):):);):):):):):):):):):););););)