armetiz Posted September 17, 2014 Share Posted September 17, 2014 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 More sharing options...
lewster32 Posted September 17, 2014 Share Posted September 17, 2014 It's not well documented, but here's how to correctly implement it: http://jsfiddle.net/lewster32/owjo33yu/ Link to comment Share on other sites More sharing options...
armetiz Posted September 17, 2014 Author Share Posted September 17, 2014 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. Also,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 ? interpolation(Phaser.Math.bezierInterpolation);Thanks for support.Regards, Link to comment Share on other sites More sharing options...
lewster32 Posted September 17, 2014 Share Posted September 17, 2014 I'm afraid I know very little about the tween interpolation stuff - it's woefully underdocumented and no examples seem to exist. Link to comment Share on other sites More sharing options...
Recommended Posts