curves-and-paths

Construct Phaser 4 paths from curve segments and sample points.

1|Updated May 3, 2026
One-click install
npx skills add https://github.com/WanderTheWeeb/papas_trauma --skill curves-and-paths-wandertheweeb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: curves-and-paths
Source: https://github.com/WanderTheWeeb/papas_trauma/tree/main/skills/curves-and-paths
Command: npx skills add https://github.com/WanderTheWeeb/papas_trauma --skill curves-and-paths-wandertheweeb

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you create and work with curve-based paths in Phaser 4, so you can reliably draw motion paths, sample points, and move sprites smoothly along complex trajectories.

Core Features & Use Cases

  • Path construction from multiple curve segments: chain lines, splines, Beziers, ellipses/circles, and manage gaps or closure for compound paths.
  • Point sampling and math utilities: get points by normalized curve parameters or arc-length spacing, plus tangents, lengths, and bounds.
  • Sprite motion via PathFollower: attach a follower to a path and configure duration, rotation-to-path, repeat/yoyo behavior, and runtime path swapping.
  • Use Case: create an enemy flight route that starts at a spawn point, follows a spline with Bezier turns, and automatically rotates to face travel direction while looping for a boss phase.

Quick Start

Set up a Path in your Scene, add curve segments to it, draw it with Graphics, and start a follower that traverses the path while rotating to its direction.

Frequently Asked Questions about curves-and-paths

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

FAQPage Schema
How do I make a sprite follow a custom Bezier path in Phaser?

To make a sprite follow a custom Bezier path in Phaser, construct a path from curve segments and attach a PathFollower to animate the sprite along the trajectory. You can configure duration, repeat, and yoyo behavior for consistent traversal playback.

How do I sample evenly spaced points along a Phaser curve?

You can sample evenly spaced points along a Phaser curve by evaluating the path using arc-length spacing parameters. The Skill computes points, tangents, lengths, and bounds using Phaser 4 Curve APIs to handle the difference between normalized parameters and actual distance.

Can I chain multiple line and spline segments into one path in Phaser 4?

Yes, you can chain multiple line and spline segments into one compound path in Phaser 4. The Skill handles path construction by connecting lines, Beziers, ellipses, and circles while managing gaps or closure for continuous trajectories.

How do I rotate a sprite to face its travel direction on a Phaser path?

To rotate a sprite to face its travel direction on a Phaser path, enable the rotateToPath option when configuring the PathFollower. This automatically adjusts the sprite's rotation to align with the tangent of the curve during tween-driven playback.

Does Phaser 4 PathFollower support runtime path swapping and looping?

Yes, Phaser 4 PathFollower supports runtime path swapping and looping. You can configure tween-driven playback settings including duration, from/to parameters, repeat, and yoyo to produce consistent traversal for gameplay scenarios like looping boss flight routes.

What is the difference between t and u parameters when evaluating Phaser curves?

The difference between t and u parameters when evaluating Phaser curves is that t represents a normalized curve parameter while u relates to arc-length spacing. The Skill uses Phaser 4 APIs to handle both for accurate point evaluation and even distance spacing.