-
Zakarus's Tale Developer
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...
Code:
onClipEvent(EnterFrame){
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!
~Zakarus2001
[Edited by Zakarus2001 on 04-26-2002 at 11:38 AM]
-
you have your basic easing equation to go straight towards a target:
this._x+=(targetx-this._x)/5;
this._y+=(targety-this._y)/5;
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.
-
Zakarus's Tale Developer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|