View Full Version : Perfect Orbit.. anyone got the code?
upuaut8
May 22nd, 2002, 08:30 AM
I'm looking for movement code that will give me a perfect orbit for an object around a point.
suprabeener
May 22nd, 2002, 01:48 PM
MovieClip.prototype.orbit = function(spd,r,xCen,yCen){
        this.s+=spd;
        this._x = Math.cos(this.s)*r + xCen;
        this._y = Math.sin(this.s)*r + yCen;
}
upuaut8
May 22nd, 2002, 08:50 PM
thanks supra.. you're supra ;)
upuaut8
May 22nd, 2002, 11:11 PM
you know.. I'm really really enjoying the prototype method building. I have been using a lot of attachMovieClip(); methods lately, but often need to add code to them all, rather than go through clumsy loops and such.
Now here's another two questions for you.
I'd like to scale my object down on one half lap of the loop, and scale it back up on the other half of loop. Obviously I'm trying to make it look like a real
how do I plot a curve from a center point, to an ever expanding radius?
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.