You can fake in with _xscale/_yscale changes...

var inc = 3;

_root.onEnterFrame = function() {
        vStar_Object._x =
(Math.cos((vStar_Object.circlePos/180)*Math.PI))*160+vStar_Object.centerX;
        vStar_Object._y =
(Math.sin((vStar_Object.circlePos/180)*Math.PI))*160+vStar_Object.centerY;
        vStar_Object.circlePos = vStar_Object.circlePos+vStar_Object.speed;
        //
        if (vStar_Object.circlePos<180) {
                vStar_Object._xscale -= inc;
                vStar_Object._yscale = vStar_Object._xscale;
        } else {
                vStar_Object._xscale += inc;
                vStar_Object._yscale = vStar_Object._xscale;
        }
        if (vStar_Object.circlePos == 360) {
                vStar_Object.circlePos = 0;
        }
        if (vStar_Object._alpha<100) {
                vStar_Object._alpha += 1;
        }
};


-Andy

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul Steven
Sent: Thursday, August 10, 2006 9:06 AM
To: 'Flashcoders mailing list'
Subject: [Flashcoders] Movement in an oval shape

I have written some code to move some stars in a circle.

This is a snippet of the code:

vStar_Object._x = (Math.cos((vStar_Object.circlePos/180)*Math.PI))*160 +
vStar_Object.centerX;
                                vStar_Object._y =
(Math.sin((vStar_Object.circlePos/180)*Math.PI))*160 + vStar_Object.centerY;

                                                
                                vStar_Object.circlePos =
vStar_Object.circlePos + vStar_Object.speed;
                                                
                                                                
if (vStar_Object.circlePos == 360) {
        vStar_Object.circlePos = 0;
}
                                                
if (vStar_Object._alpha < 100) {
        vStar_Object._alpha +=1;
}

This seems to work just fine.

Anyway I need to change this so they move in an oval shape (like an egg on
its side)

Not being a mathematics expert I wondered if anyone can suggest how I can
amend my code to do so.

Thanks

Paul

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to