Playing with Phaser Tweens and Bezier curves

Article by Richard Davey. Posted on 25th Aug 2015.   @phaser_

image

"Are you tired to create straight paths with your Phaser Tweens? Do you want the enemies in your game to follow a more unpredictable path? Have a try with Bezier curves.

A Bezier curve is a mathematically defined curve used in two-dimensional graphic applications. The curve is defined by four points: the initial position and the terminating position (which are called “anchors”) and two separate middle points (which are called “handles”).

The shape of a Bezier curve can be altered by moving the handles. The mathematical method for drawing curves was created by Pierre Bézier in the late 1960’s for the manufacturing of automobiles at Renault.

End of the boring theory, play with this prototype:"

Read More