Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

How to use interpolation with Tween


Recommended Posts

Hi there,


First of all, thanks for this framework. You did a very good job.


I'm trying to move a sprite along a defined path. Between each of movement, I don't want a linear interpolation, but a Beizer one.


I saw this topic : http://www.html5gamedevs.com/topic/6569-move-a-sprite-along-a-path/


But, there is really few documentation around this feature and values are cryptic.


Can you explain more with the following example ? Or maybe an other one.


this.game.add.tween(sprite).to({    y: [a, b, c, d],    x: [w, x, y, z]}, 5000).interpolation(Phaser.Math.bezierInterpolation).start();


Link to comment
Share on other sites

Hi @lewset32,


Thanks for your reply.


Using the wikipedia page : http://en.wikipedia.org/wiki/B%C3%A9zier_curve


I have made the following example : http://jsfiddle.net/owjo33yu/3/


Is this ok ? The result seems to be ok but I want to be sure about values interpretation.



The tween chain using interpolation is not working. And I don't think this is normal.

Here a chaining example : http://jsfiddle.net/owjo33yu/4/


An other related question,

Why is this not working ? 


Thanks for support.


Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...