本文へスキップ
Kitbay
スキル

curves-and-paths

MIT2026年8月21日 更新40,693GitHubスター

A reference skill published in the Phaser game framework's own repository for building and using curves and paths in Phaser 4.

スキルの内容

A reference skill published in the Phaser game framework's own repository for building and using curves and paths in Phaser 4. It explains that a path joins several curves, which need not touch, and covers lines, Catmull-Rom splines, cubic and quadratic Bezier curves and ellipse arcs, the shared methods for sampling points, lengths, bounds and tangents, the builder methods such as lineTo, splineTo and moveTo, and drawing a path with Graphics. It also covers path followers, sprites that move along a path through an internal tween, with rotation and offset options. A list of pitfalls covers uneven spacing from getPoint, mixed angle units on ellipses and lengths that go stale after edits.

できること

  • Build paths from lines, splines and Bezier curves
  • Sample evenly spaced points along a curve
  • Make sprites follow a path
  • Draw paths with Graphics