Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

Move object by curve line

Recommended Posts

Hello everyone. I want to realize move animation with objects which moves from point A to point B with some ease setting but not as the crow flies, it should move by some curve line a it should looks llke the object describes a circle. Is it possible ?


For examle we have scene 400*400, and to objects in positions (0,200) * (400,200) and tweens move them to (200,0) and (200,400) but they move by curve line and and animation looks like both object first move to center of a scene and then to their positions


Example: http://www.gamedev.ru/files/images/?id=109474  

Link to comment
Share on other sites

Thank you, Carl. Tell me one more thing I have already tried using CirlcePath2d now I will try your example but I use starling and try to move starling display objects should I do something with degrees when I rotate starling objects, convert to radians maybe, or it will be correct?! In circlepath2d something was rather strange with rotation.

Link to comment
Share on other sites

If you need to autoRotate along the BezierPlugin path you can specify radians as the units as noted in the docs


autoRotate : Boolean or Array (default:false) - to automatically rotate the target according to its position on the Bezier path, you can use the autoRotate feature (previously called orientToBezier). If your Bezier is affecting the "x" and "y" properties of your target and you don't need to offset the rotation by a certain amount more than normal, then you can simply set autoRotate:true. Or if you want to offset the rotation by a certain amount (in degrees), you can define a number like autoRotate:90 (adding 90 degrees in this example). Or for more advanced controls, you can define autoRotate as an array. In order to adjust a rotation property accurately, the plugin needs 5 pieces of information:

Position property 1 (typically "x")

Position property 2 (typically "y")

Rotational property (typically "rotation")

Number of degrees (or radians) to add to the new rotation (optional - makes it easy to orient your target properly)

Boolean value indicating whether or not the rotational property should be defined in radians rather than degrees (default is false which results in degrees)


Hopefully that helps. I don't have any experience with Starling.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.