geometry-and-math

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

Updated Sep 20, 2026
One-click install
npx skills add https://github.com/AmirOssanloo/helix-game --skill geometry-and-math-amirossanloo
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: geometry-and-math
Source: https://github.com/AmirOssanloo/helix-game/tree/main/.claude/skills/geometry-and-math
Command: npx skills add https://github.com/AmirOssanloo/helix-game --skill geometry-and-math-amirossanloo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Phaser 4's geometry and math APIs are spread across dozens of namespaces, making it hard to recall the correct class, static helper, or intersection function when building 2D game logic. This Skill consolidates the full API surface into one reference so you write correct vector, shape, and collision math on the first attempt. ## Core Features & Use Cases - Geometry Classes: Covers Circle, Ellipse, Line, Polygon, Rectangle, and Triangle with constructors, properties, and static helper functions. - Intersection Tests: Documents all boolean overlap checks and Get* functions that return intersection points under Phaser.Geom.Intersects. - Math Utilities: Includes Vector2, Vector3, Matrix4, angles, distances, interpolation, easing, snapping, fuzzy comparison, and the seeded RandomDataGenerator. - Use Case: When implementing a spell projectile in a Phaser game, use this Skill to find the right CircleToRectangle intersection test, compute the launch angle with Phaser.Math.Angle.Between, and normalize the velocity vector. ## Quick Start Ask the AI to show how to test whether a circle overlaps a rectangle in Phaser 4 and compute the intersection points.

Frequently Asked Questions about geometry-and-math

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

FAQPage Schema
How do I check if a circle overlaps a rectangle in Phaser?▼

Use Phaser.Geom.Intersects.CircleToRectangle(circle, rect), which returns a boolean. To get the actual intersection points instead, call Phaser.Geom.Intersects.GetCircleToRectangle(circle, rect, out) and pass a reusable output array.

How to calculate distance and angle between two points in Phaser 4?▼

Use Phaser.Math.Distance.Between(x1, y1, x2, y2) for Euclidean distance and Phaser.Math.Angle.Between(x1, y1, x2, y2) for the angle in radians. For comparisons only, Distance.Squared avoids the costly square root.

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 still exists but the class itself does not.

Can Phaser geometry objects be rendered directly to the screen?▼

No, Geom objects like Rectangle and Circle are pure data containers and cannot be added to the display list. To render them, use the Graphics game object or Shape game objects.

How do I create reproducible random sequences in Phaser?▼

Create a seeded RandomDataGenerator with new Phaser.Math.RandomDataGenerator(['my-seed']) or set the seed in the game config. Call rnd.state() to serialize the generator state and restore it later for deterministic replay.

Why do my Phaser easing strings not behave as expected?▼

Short easing names like 'Quad' default to the .Out variant, so 'Quad' means Quadratic.Out rather than Quadratic.In. Use full string keys such as 'Quad.easeIn' or 'Sine.easeInOut' to select other variants.