Question

I am diving into Tween.js for some elementary animation.

It seems like for making a ball move across a fixed path you need the MotionGuide plugin. Here is a document at :

http://www.createjs.com/Docs/TweenJS/classes/MotionGuidePlugin.html

I want to make my object move in a sort of an inverted L shaped maze, how do I change the array values in the supplied path object? The values as the documents imply are translating to moveTo and curveTo calls.

I am not sure as to how to make it traverse a fixed L shaped path. Any clues?

Was it helpful?

Solution

By looking at the code of the Plugin, it just seems to be able to use curveTo with a single moveTo at the start, but you can also do straight lines with that but positioning the anchor-points in the middle between two points - However, in your case you could(and that's how I would do it) use the regular tween .to() and just chain the calls to each corner if the path has only straight lines and hard corners.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top