Token导航 LogoToken导航

Agent Skill · 待分类

curves-and-paths(曲线和路径)

curves-and-paths 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

curves-and-paths 是待分类类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为权限未标注;许可证信息还不明确,第三方扫描已通过,按安装量在待分类类的 11,209 个 Skill 里排第 3,549。

总安装 974周安装 41GitHub Stars 39,511下载 341核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:curves-and-paths(曲线和路径)
来源仓库:https://github.com/phaserjs/phaser
仓库路径:skills/curves-and-paths
安装命令:
npx skills add https://github.com/phaserjs/phaser --skill curves-and-paths
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/phaserjs/phaser --skill curves-and-paths

这个 Skill 是做什么的

这个 Skill 的分类还没最终确定,用法以来源仓库的说明为准。

curves-and-paths 用于在 Phaser 4 中创建路径、绘制曲线并使精灵沿路径移动。适用于游戏开发中的动画轨迹和对象运动控制。需结合 Graphics 和 PathFollower 组件使用,确保渲染正确。涉及坐标计算时应注意坐标系和缩放比例的一致性。

适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/curves-and-paths

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/phaserjs/phaser --skill curves-and-paths;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    权限没有明确标注,第一次使用时只给一个无关紧要的任务,观察它到底读了哪些文件和网络。

常见问题

6 条

curves-and-paths 怎么安装?

在终端执行 npx skills add https://github.com/phaserjs/phaser --skill curves-and-paths。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

curves-and-paths 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

curves-and-paths 需要什么权限?

权限级别没有明确标注。第一次使用时建议只给无关紧要的任务,观察它实际读写了哪些内容。

curves-and-paths 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

curves-and-paths 用的人多吗?

公开数据是累计安装 974 次,近一周安装 41 次,下载 341 次,GitHub 39,511 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

curves-and-paths 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 来源仓库有 39,511 星,维护活跃度相对可查。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理待分类类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

待分类类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
infsh-cli

infsh CLI · Codex、Claude

4,374,576382权限未标注未明确未收录
ai-video-generation

AI 视频生成 · Codex、Claude

4,313,376382调用外部服务未明确有提醒
lark-openapi-explorer

云雀 OpenAPI 浏览器 · Codex、Claude

2,064,1209,011需要联网未明确有提醒
lark-workflow-standup-report

Lark 工作流程站立报告 · Codex、Claude

2,041,6328,978需要联网未明确通过
use-my-browser

使用我的浏览器 · Codex、Claude

1,848,49140操作浏览器未明确未通过
curves-and-paths

曲线和路径 · 本页

97439,511权限未标注未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Curves and Paths

Creating paths from curves, getting points along them, drawing them with Graphics, and making sprites follow paths automatically using PathFollower in Phaser 4.

Key source paths: src/curves/, src/curves/path/, src/gameobjects/pathfollower/, src/gameobjects/components/PathFollower.js Related skills:../sprites-and-images/SKILL.md,../graphics-and-shapes/SKILL.md,../tweens/SKILL.md

Quick Start

// In a Scene's create() method:

// 1. Create a Path starting at (50, 300)
const path = this.add.path(50, 300);

// 2. Add curves to the path
path.lineTo(200, 100);
path.splineTo([ new Phaser.Math.Vector2(300, 400), new Phaser.Math.Vector2(500, 200) ]);
path.lineTo(700, 300);

// 3. Draw the path using Graphics
const graphics = this.add.graphics();
graphics.lineStyle(2, 0xffffff, 1);
path.draw(graphics, 64);

// 4. Create a PathFollower sprite that moves along the path
const follower = this.add.follower(path, 50, 300, 'ship');
follower.startFollow({
    duration: 5000,
    rotateToPath: true,
    repeat: -1,
    yoyo: true
});

Core Concepts

Path

A Phaser.Curves.Path is a container that combines multiple Curves into one continuous compound curve. Curves in a Path do not need to be connected end-to-end. Only the order of curves affects point calculations along the path.

Created via factory: this.add.path(x, y) where x/y is the starting point.

Key properties:

  • curves -- array of Phaser.Curves.Curve objects in the Path
  • startPoint -- Vector2, the defined starting position
  • autoClose -- boolean, if true getPoints() appends the first point at the end
  • defaultDivisions -- number (default: 12), divisions per curve when calling getPoints()
  • name -- string, empty by default, for developer use

Curves

All curve types extend Phaser.Curves.Curve (the base class). Every curve supports:

  • getPoint(t, out) -- get a point at position t (0-1) based on curve parameterization
  • getPointAt(u, out) -- get a point at position u (0-1) based on arc length (evenly spaced)
  • getPoints(divisions, stepRate, out) -- array of points along the curve
  • getSpacedPoints(divisions, stepRate, out) -- array of equidistant points by arc length
  • getDistancePoints(distance) -- points spaced by pixel distance
  • getLength() -- total arc length in pixels
  • getBounds(out, accuracy) -- bounding Rectangle
  • getTangent(t, out) / getTangentAt(u, out) -- unit tangent vector
  • getStartPoint(out) / getEndPoint(out) -- first/last points
  • getRandomPoint(out) -- random point on the curve
  • draw(graphics, pointsTotal) -- render the curve onto a Graphics object
  • active -- boolean, when false the parent Path skips this curve

PathFollower

A Phaser.GameObjects.PathFollower is a Sprite with the Components.PathFollower mixin. It uses an internal Tween (a number counter from 0 to 1) to advance along a Path each frame.

Created via factory: this.add.follower(path, x, y, texture, frame)

The PathFollower component provides:

  • path -- the Phaser.Curves.Path being followed
  • pathTween -- the internal Tween driving movement
  • pathOffset -- Vector2, offset added to path coordinates
  • pathVector -- Vector2, current position on the path
  • pathDelta -- Vector2, distance traveled since last frame
  • rotateToPath -- boolean, auto-rotate to face path direction
  • pathRotationOffset -- number (degrees), added to auto-rotation

Common Patterns

Creating Paths with Chained Curves

Path has convenience methods that create curves starting from the previous end point:

const path = this.add.path(100, 500);

path.lineTo(300, 100);                          // straight line
path.cubicBezierTo(500, 100, 350, 50, 450, 50); // cubic bezier (endX, endY, cp1X, cp1Y, cp2X, cp2Y)
path.quadraticBezierTo(700, 400, 600, 100);     // quadratic bezier (endX, endY, cpX, cpY)
path.splineTo([                                  // spline through points
    new Phaser.Math.Vector2(750, 300),
    new Phaser.Math.Vector2(600, 500)
]);
path.ellipseTo(50, 80, 0, 270, false, 0);       // ellipse arc (xRadius, yRadius, startAngle, endAngle, clockwise, rotation)
path.circleTo(40);                               // shortcut for ellipseTo with equal radii and 0-360

// Jump to a new position without drawing (creates a gap)
path.moveTo(400, 400);
path.lineTo(500, 400);

// Close the path by connecting end to start
path.closePath();

Adding Standalone Curve Objects

const path = new Phaser.Curves.Path(0, 0);

// Add pre-constructed curve objects
const line = new Phaser.Curves.Line(new Phaser.Math.Vector2(0, 0), new Phaser.Math.Vector2(200, 200));
path.add(line);

const spline = new Phaser.Curves.Spline([ 200, 200, 300, 100, 400, 300 ]);
path.add(spline);

const ellipse = new Phaser.Curves.Ellipse(400, 300, 100, 60, 0, 360, false, 0);
path.add(ellipse);

Getting Points Along a Path

// Array of points (uses defaultDivisions per curve)
const points = path.getPoints();

// With explicit divisions per curve
const detailed = path.getPoints(32);

// Equally spaced points along the entire path
const spaced = path.getSpacedPoints(100);

// Single point at normalized position (0-1)
const midpoint = path.getPoint(0.5);

// Tangent vector at a position
const tangent = path.getTangent(0.5);

// Total path length in pixels
const length = path.getLength();

// Bounding rectangle
const bounds = path.getBounds();

Drawing Paths with Graphics

const graphics = this.add.graphics();

// Draw entire path
graphics.lineStyle(2, 0x00ff00, 1);
path.draw(graphics, 64); // 64 = points per curve for smoothness

// Draw individual curves
graphics.lineStyle(1, 0xff0000, 1);
path.curves[0].draw(graphics, 32);

// Draw debug points
const points = path.getSpacedPoints(50);
points.forEach(p => {
    graphics.fillStyle(0xffff00, 1);
    graphics.fillCircle(p.x, p.y, 3);
});

PathFollower Sprite

const path = this.add.path(100, 200);
path.lineTo(400, 400);
path.lineTo(700, 200);

// Create follower
const enemy = this.add.follower(path, 100, 200, 'enemy');

// Start following with config
enemy.startFollow({
    duration: 3000,       // ms to traverse path
    positionOnPath: true, // snap to path start position
    rotateToPath: true,   // auto-rotate to face direction
    rotationOffset: 90,   // offset added to auto-rotation (degrees)
    repeat: -1,           // -1 = infinite repeat
    yoyo: true,           // reverse on each repeat
    from: 0,              // start position on path (0-1)
    to: 1,                // end position on path (0-1)
    startAt: 0,           // initial seek position
    ease: 'Sine.easeInOut' // any valid Phaser ease
});

// Control during playback
enemy.pauseFollow();
enemy.resumeFollow();
enemy.stopFollow();
enemy.isFollowing(); // returns boolean

// Change path at runtime
enemy.setPath(newPath);
enemy.setPath(newPath, { duration: 2000 }); // auto-starts

// Set rotation independently
enemy.setRotateToPath(true, 90); // (value, offsetDegrees)

PathFollower with Simple Duration

// Shorthand: pass just a duration number
enemy.startFollow(5000);

// Equivalent to:
enemy.startFollow({ duration: 5000 });

All Curve Types

CurveClassConstructor ParamsDescription
LinePhaser.Curves.Line(p0, p1) Vector2 endpoints, or ([x0,y0,x1,y1])Straight line segment between two points
SplinePhaser.Curves.Spline(points) array of Vector2, flat numbers, or nested arraysCatmull-Rom spline through control points
CubicBezierPhaser.Curves.CubicBezier(p0, p1, p2, p3) or ([x0,y0,...x3,y3])Cubic Bezier with start, 2 control points, end
QuadraticBezierPhaser.Curves.QuadraticBezier(p0, p1, p2) or ([x0,y0,...x2,y2])Quadratic Bezier with start, 1 control point, end
EllipsePhaser.Curves.Ellipse(x, y, xRadius, yRadius, startAngle, endAngle, clockwise, rotation) or config objectElliptical arc; angles in degrees; yRadius defaults to xRadius

Ellipse Curve Properties

The Ellipse curve has get/set properties for runtime modification:

  • x, y -- center position
  • xRadius, yRadius -- radii
  • startAngle, endAngle -- in degrees (get/set convert to/from radians internally)
  • clockwise -- boolean
  • rotation -- in radians
  • angle -- rotation in degrees (alternative to rotation)
  • setWidth(value) / setHeight(value) -- sets radius to value/2

API Quick Reference

Path (Phaser.Curves.Path)

APITypeDescription
add(curve)methodAppend any Curve to the path
lineTo(x, y)methodAdd a Line from current end point
splineTo(points)methodAdd a Spline from current end point
cubicBezierTo(x, y, cp1X, cp1Y, cp2X, cp2Y)methodAdd CubicBezier from current end point
quadraticBezierTo(x, y, cpX, cpY)methodAdd QuadraticBezier from current end point
ellipseTo(xR, yR, start, end, cw, rot)methodAdd Ellipse arc from current end point
circleTo(radius, clockwise, rotation)methodShortcut for ellipseTo with equal radii
moveTo(x, y)methodMove end point without drawing (creates gap)
closePath()methodAdd Line from end to start if not already closed
getPoint(t, out)methodPoint at normalized position (0-1) on entire path
getPoints(divisions, stepRate)methodArray of points, divisions per curve
getSpacedPoints(divisions)methodEquidistant points along entire path
getRandomPoint(out)methodRandom point anywhere on the path
getStartPoint(out)methodPath starting point
getEndPoint(out)methodPath ending point
getTangent(t, out)methodUnit tangent vector at position t
getCurveAt(t)methodReturn the Curve at normalized position t
getLength()methodTotal path length in pixels
getCurveLengths()methodArray of cumulative curve lengths
getBounds(out, accuracy)methodBounding Rectangle
draw(graphics, pointsTotal)methodDraw all curves onto a Graphics object
toJSON() / fromJSON(data)methodSerialization
updateArcLengths()methodForce recalculation of cached lengths
destroy()methodClear internal references

Base Curve (Phaser.Curves.Curve)

APITypeDescription
getPoint(t, out)methodPoint at parameter t (0-1) -- abstract, each subclass implements
getPointAt(u, out)methodPoint at arc-length position u (0-1) -- evenly spaced
getPoints(divisions, stepRate, out)methodArray of points
getSpacedPoints(divisions, stepRate, out)methodEquidistant points by arc length
getDistancePoints(distance)methodPoints spaced by pixel distance
getLength()methodTotal curve arc length
getTangent(t, out) / getTangentAt(u, out)methodUnit tangent vector
getTFromDistance(distance)methodConvert pixel distance to t value
draw(graphics, pointsTotal)methodRender onto Graphics (default 32 points)
getBounds(out, accuracy)methodBounding Rectangle
activebooleanWhen false, parent Path skips this curve
defaultDivisionsnumberDefault 5 for standalone curves
arcLengthDivisionsnumberPrecision for arc length calculations (default 100)

PathFollower Component

APITypeDescription
setPath(path, config)methodSet a new Path (optionally auto-start)
startFollow(config, startAt)methodBegin following; config = duration number or PathConfig
pauseFollow()methodPause movement
resumeFollow()methodResume paused movement
stopFollow()methodStop following
isFollowing()methodReturns true if actively moving on path
setRotateToPath(value, offset)methodEnable/disable auto-rotation with offset
pathPathCurrent path reference
pathTweenTweenInternal tween driving movement
pathOffsetVector2Offset from path coordinates
pathVectorVector2Current position on the path
pathDeltaVector2Movement delta since last update
rotateToPathbooleanAuto-rotate to path direction
pathRotationOffsetnumberRotation offset in degrees

PathConfig (Phaser.Types.GameObjects.PathFollower.PathConfig)

PropertyTypeDefaultDescription
durationnumber1000Time in ms to traverse the path
fromnumber0Start position on path (0-1)
tonumber1End position on path (0-1)
positionOnPathbooleanfalseSnap follower to path start on begin
rotateToPathbooleanfalseAuto-rotate to face path direction
rotationOffsetnumber0Degrees added to auto-rotation
startAtnumber0Initial seek position on path (0-1)

The config also accepts all standard Tween properties: ease, repeat, yoyo, delay, hold, onComplete, etc.

Gotchas

  1. getPoint(t) vs getPointAt(u) on curves. getPoint uses the raw curve parameter t, which does not produce evenly spaced points on most curve types. getPointAt maps through arc length for even spacing. On a Path, getPoint already accounts for arc length across the whole path.
  2. Path moveTo creates an inactive curve. The MoveTo pseudo-curve has active: false and zero length. It only repositions the end point for the next curve. It does not draw anything and is skipped by getPoints() and draw().
  3. PathFollower uses a Tween internally. The startFollow config is passed to scene.tweens.addCounter(). All tween properties (ease, delay, repeat, yoyo, callbacks) work. The tween is set to persist: true automatically.
  4. PathFollower offset behavior. When positionOnPath: false (default), the follower's current position becomes the offset from the path start. When positionOnPath: true, the follower snaps to the path's start point and the offset is zeroed.
  5. Ellipse angles are in degrees. The constructor and startAngle/endAngle properties accept degrees. Internally they are stored as radians. The rotation property is in radians, but angle is in degrees.
  6. closePath vs autoClose. closePath() adds an explicit Line curve from end to start. autoClose = true only affects getPoints() and getSpacedPoints() output by appending the first point, without adding a curve.
  7. Cached lengths can go stale. getCurveLengths() caches results based on array length only. If you modify a curve's control points, call path.updateArcLengths() to force recalculation.
  8. cubicBezierTo parameter order with numbers. When passing numbers: cubicBezierTo(endX, endY, cp1X, cp1Y, cp2X, cp2Y). The end point comes first, not the control points. When passing Vector2 objects: cubicBezierTo(cp1, cp2, endPoint).
  9. Spline needs at least 4 points. The Catmull-Rom interpolation used by Spline works best with 4+ points. With fewer points, the curve may not behave as expected.
  10. Line curve arcLengthDivisions is 1. Unlike other curves (default 100), Line overrides this to 1 since a line is inherently uniform. No need to adjust it.

Source File Map

FilePurpose
src/curves/path/Path.jsPath class -- combines multiple curves, factory registered as this.add.path
src/curves/path/MoveTo.jsMoveTo pseudo-curve for creating gaps in paths
src/curves/Curve.jsBase Curve class -- shared methods for all curve types
src/curves/LineCurve.jsLine curve (two-point segment)
src/curves/SplineCurve.jsSpline curve (Catmull-Rom through multiple points)
src/curves/CubicBezierCurve.jsCubic Bezier curve (4 control points)
src/curves/QuadraticBezierCurve.jsQuadratic Bezier curve (3 control points)
src/curves/EllipseCurve.jsEllipse/arc curve with angle and rotation support
src/gameobjects/pathfollower/PathFollower.jsPathFollower Game Object (extends Sprite + PathFollower mixin)
src/gameobjects/pathfollower/PathFollowerFactory.jsthis.add.follower factory registration
src/gameobjects/components/PathFollower.jsPathFollower component mixin (setPath, startFollow, pathUpdate, etc.)
src/gameobjects/pathfollower/typedefs/PathConfig.jsPathConfig typedef

平台分布

Codex

37.64%
按下载量换算128

Claude

28.79%
按下载量换算98

Cursor

19.39%
按下载量换算66

Gemini CLI

10.25%
按下载量换算35

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

权限未标注

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills