Follow Specific Path

Can someone please point me in the right direction?

I have spent four days reading though docs and example code. I want to make an object follow a predetermined path(s) with the option select a choice to make a change in direction along the path.

I want this to run with a user “touch” event (via a button) listener with increase-able/decrease-able speed; not at the enterFrame Runtime.

I know I can make an object go from point A to B via a transition.to however; I am looking for something to be able to follow a line that potentially has an “S” curve in it.

As always any support provide is greatly appreciated.

Thanks
Rob
[import]uid: 16527 topic_id: 20881 reply_id: 320881[/import]

The basic principle is that you have an table (array) of x,y coordinates that represent the line. Your object starts at the first one then moves to the 2nd one, then to the third one until it’s move along all points.

The more points you have the smoother the movement will be.

[import]uid: 19626 topic_id: 20881 reply_id: 82260[/import]

look at this

http://developer.anscamobile.com/code/bezier-curves-corona

and

http://developer.anscamobile.com/code/bezier-object-along-curves-path

and

http://www.carlosicaza.com/2011/04/23/moving-an-object-along-a-bezier-curve-part-i/

and

http://www.carlosicaza.com/2011/05/05/moving-an-object-along-a-bezier-curve-part-ii/

hope these will help.

c.
[import]uid: 24 topic_id: 20881 reply_id: 82312[/import]

@robmiracle:

Thanks for the advice; I think it will give me something to focus on for a bit. I am almost putting it together in this slow head of mine. Thanks. Rob.

@Carlos,

Thanks for the information.

Rob

[import]uid: 16527 topic_id: 20881 reply_id: 82345[/import]