Phaser home
Phaser AE
Open source
Phaser 4
Download
Learn
Editor
Tools
Docs
Examples
News
Log in
Examples
/
Paths
/
Curves
Phaser 4.1.0
Phaser 4 examples
Curves
29
examples
Examples
29
Cubic Bezier Bounds
Learn how to calculate and display the bounding box of a Cubic Bezier curve. This example features interactive control points that update the curve shape and its bounds in real-time.
Cubic Bezier Curve
Create a cubic Bezier curve using start, end, and two control points, and animate an object moving along the path using a tween.
Cubic Bezier Curve Debug
Visualizes the mathematical construction of a Cubic Bezier curve using linear interpolation across control points and intermediate lines.
Cubic Bezier Path Points
Demonstrates how to extract evenly spaced points or specific coordinates along a Cubic Bezier curve using getPoints and getPoint.
Drag Cubic Bezier Curve
Create and manipulate a Cubic Bezier curve by dragging its start, end, and control points, while an object follows the path via a tween.
Drag Quadratic Bezier Curve
Manipulate a Quadratic Bezier curve in real-time by dragging its start, end, and control points while an object animates along the path.
Drag Spline Curve
Demonstrates an interactive spline curve where control points can be dragged to reshape the path in real-time while an object follows the curve.
Draggable Line Curve
Demonstrates how to create a Line curve and interactively update its start and end points using draggable handle objects.
Ellipse Curve Animation
Demonstrates how to create an elliptical path and animate its x and y radius over time while moving an object along the curve.
Ellipse Curve Bounds
Demonstrates how to calculate and visualize the bounding box of an interactive Ellipse curve. Includes real-time controls for radius, rotation, and start/end angles.
Get Point at Distance on Line Curve
Demonstrates how to find the specific coordinates of a point located at a certain pixel distance along a line curve using getTFromDistance.
Get Point from Spline Curve
Demonstrates how to use getPointAt to find specific coordinates along a Spline curve based on a normalized value between 0 and 1.
Get Points on a Line Curve
Demonstrates how to use the getPoints method to sample a specific number of coordinate points at regular intervals along a linear path.
Get Points on Cubic Bezier Curve
Extract an array of coordinate points at regular intervals along a Cubic Bezier curve and visualize them using Graphics.
Get Spaced Points on a Cubic Bezier Curve
Extract and visualize a set of points distributed at equal distances along a Cubic Bezier curve using the getSpacedPoints method.
Get Spaced Points vs. Get Points
Demonstrates the difference between points sampled at segment intervals versus points distributed at equal distances along the entire path length.
Get Tangent Vectors on Cubic Bezier Curve
Learn how to extract and visualize tangent and normal vectors at specific points along a cubic Bezier curve to determine direction and orientation.
Interactive Ellipse Curve Parameters
Adjust an Ellipse curve's dimensions, rotation, and start/end angles using interactive sliders and a draggable center point while an object follows the path.
Interactive Spline Curve Bounds
Demonstrates how to calculate and update the bounding box of a Spline curve in real-time using interactive drag-handles to modify the curve points.
Line Curve
Demonstrates creating a simple straight-line curve and animating a point along its path using a tween.
Line Curve Bounds
Demonstrates how to calculate and update the bounding box of a line curve as its endpoints are moved via drag-and-drop handles.
Quadratic Bezier Curve
Create a quadratic Bezier curve and animate a point along its path using a tween to interpolate the position.
Rectangle Spline Intersection
Learn how to detect collisions between a draggable sprite and a complex Spline curve by combining bounding box checks with segment-level line-to-rectangle intersection tests.
Spaced Points on a Line Curve
Demonstrates how to retrieve a specific number of evenly distributed points along a straight line curve.
Spline Between Points
Demonstrates how to create a smooth spline curve between two points by calculating midpoints and normals to generate oscillating control points along a straight line.
Spline Builder
Interactively build and modify a Spline curve by clicking to add new points and dragging existing control handles. A sprite moves along the generated path using a tween.
Spline Curve
Create a smooth Spline curve from an array of points and animate a point along its length using the getPoint method and a Tween.
Spline Curve Distance Points
Demonstrates how to generate an array of points along a spline curve spaced at a specific pixel distance using the getDistancePoints method.
Spline Curve from Coordinate Array
Demonstrates how to create a smooth Spline curve by passing a flat array of X and Y coordinates to the constructor.