geometry-and-math

Reference Phaser 4 geometry classes, intersection tests, and math utilities for game development.

Updated Jul 13, 2026
One-click install
npx skills add https://github.com/russellmorgan/UnderConstruction --skill geometry-and-math-russellmorgan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: geometry-and-math
Source: https://github.com/russellmorgan/UnderConstruction/tree/main/.claude/skills/geometry-and-math
Command: npx skills add https://github.com/russellmorgan/UnderConstruction --skill geometry-and-math-russellmorgan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Phaser 4 developers need accurate API details for geometry objects, vectors, matrices, intersection tests, easing, and random number generation, and this Skill provides a complete reference so code is written correctly the first time. ## Core Features & Use Cases - Geometry Classes: Covers Circle, Ellipse, Line, Polygon, Rectangle, and Triangle with constructors, properties, static helpers, and containment tests. - Intersection Tests: Documents all Phaser.Geom.Intersects boolean checks and Get* functions that return intersection points. - Math Utilities: Details Vector2, Vector3, Matrix4, angles, distances, interpolation, easing, snapping, fuzzy comparison, and the seeded RandomDataGenerator. - Use Case: When building a Pachinko-style game, use this Skill to compute peg collision angles with Phaser.Math.Angle.Between, test ball-to-zone overlap with Intersects.CircleToRectangle, and generate reproducible board layouts with a seeded RandomDataGenerator. ## Quick Start Ask the AI to show how to test whether a circle overlaps a rectangle and compute the bounce angle using Phaser 4 geometry and math utilities.

Frequently Asked Questions about geometry-and-math

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

FAQPage Schema
How do I test collision between a circle and rectangle in Phaser 4?▼

Use Phaser.Geom.Intersects.CircleToRectangle(circle, rect) for a boolean overlap test. To get the actual intersection points, use Phaser.Geom.Intersects.GetCircleToRectangle, optionally passing a reusable out array to avoid allocations.

How to generate seeded random numbers in Phaser 4?▼

Use Phaser.Math.RandomDataGenerator with a seed array like new RandomDataGenerator(['level-42']) for reproducible sequences. The global Phaser.Math.RND instance is seeded via the game config seed property, and rnd.state() serializes state for save/load.

Does Phaser 4 still have the Point class?▼

No, the Point class was removed in Phaser 4. Use Phaser.Math.Vector2 or plain {x, y} objects instead. The GEOM_CONST.POINT constant exists but the class itself does not.

Are Phaser Geom objects renderable game objects?▼

No, Geom objects are pure data containers with no scene, texture, or display list presence. To render them, use the Graphics game object or Shape game objects, which are covered by the graphics-and-shapes skill.

Why does my Phaser angle calculation give wrong results?▼

Phaser math functions use radians, not degrees. Convert with Phaser.Math.DegToRad() and RadToDeg(), and use Phaser.Math.TAU for full-circle constants. Also note Vector2 methods mutate in place, so call clone() to preserve originals.

What easing string names does Phaser 4 accept for tweens?▼

Tweens accept strings like 'Sine.easeOut', 'Cubic.easeIn', or 'Back.easeInOut' mapped via EaseMap. Short names like 'Quad' default to the Out variant, and Power0 through Power4 alias Linear through Quint.Out.