curves-and-paths

Create and animate Phaser 4 paths with Path and Curve utilities.

Updated Jun 21, 2021
One-click install
npx skills add https://github.com/mahirocoko/mahirocoko --skill curves-and-paths-mahirocoko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: curves-and-paths
Source: https://github.com/mahirocoko/mahirocoko/tree/main/plugins/phaser/skills/curves-and-paths
Command: npx skills add https://github.com/mahirocoko/mahirocoko --skill curves-and-paths-mahirocoko

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Designers and developers struggle to implement smooth, accurate movement and visualization along curves and paths in Phaser 4, requiring complex math and boilerplate. This skill consolidates path creation, curve types, and path-following into a single, reusable toolkit.

Core Features & Use Cases

  • Create and compose multiple curve types (Line, Spline, CubicBezier, QuadraticBezier, Ellipse) into a single Phaser.Curves.Path.
  • Move sprites along paths with PathFollower, including rotation, speed, looping, and on-path offsets for dynamic gameplay visuals.
  • Render and debug paths with Graphics, measure lengths, and query points or tangents for precise gameplay mechanics.

Quick Start

Create a Phaser Path from (start at 50, 50), add lines and curves, then attach a PathFollower to a sprite and start following.

Frequently Asked Questions about curves-and-paths

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I move a sprite along a bezier curve in Phaser?

You can move a sprite along a bezier path in Phaser by creating a Phaser.Curves.Path, adding the desired curve type, and integrating the PathFollower utility to automate sprite movement, rotation, and looping.

What curve types are supported for building paths in Phaser 4?

Supported curve types for building paths in Phaser 4 include Line, Spline, CubicBezier, QuadraticBezier, and Ellipse, which can all be composed into a single continuous Phaser.Curves.Path for complex animations.

How do I render and debug a Phaser path on screen?

To render and debug a Phaser path on screen, you use the Graphics API to visualize the curves, measure path lengths, and query specific points or tangents to ensure accurate gameplay mechanics and visual alignment.

Can I adjust speed and rotation when using PathFollower in Phaser?

Yes, when using PathFollower in Phaser, you can configure speed, rotation, looping, and on-path offsets to achieve dynamic gameplay visuals and precise control over how sprites track along the defined path.

How do I calculate points and measure length on a Phaser curve?

You calculate points and measure length on a Phaser curve by utilizing the built-in Path and Curve API utilities, which support point calculation, tangent querying, and length measurement for precise runtime parameterization.

Does this Phaser path animation approach require complex math?

No, this approach eliminates the need for complex math and boilerplate by consolidating path creation, diverse curve types, and path-following logic into a single reusable toolkit for Phaser 4 game development.