geometry-and-math

Guide Phaser 4 geometry and math utilities for shapes and computations.

Updated Apr 26, 2026
One-click install
npx skills add https://github.com/kehwar/pixi-square --skill geometry-and-math-kehwar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: geometry-and-math
Source: https://github.com/kehwar/pixi-square/tree/main/.agents/skills/geometry-and-math
Command: npx skills add https://github.com/kehwar/pixi-square --skill geometry-and-math-kehwar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Phaser-based games often require robust geometry and math utilities to manage pure data shapes and perform calculations without rendering concerns. This skill consolidates knowledge of shape classes, intersection tests, and math helpers to streamline development.

Core Features & Use Cases

  • Geometry classes (Circle, Ellipse, Rectangle, Line, Polygon, Triangle) for data-only shapes and quick tests.
  • Intersections and containment checks to support collision logic and UI hit testing.
  • Phaser.Math utilities (distance, angle, interpolation, snapping, random, vectors) for gameplay calculations.
  • Use Case: quickly prototype pathfinding, distance-based triggers, or geometry-based effects in Phaser 4.

Quick Start

Create geometry objects (Rectangle, Circle, Line) and test containment, intersections, and math utilities using Phaser.Geom.

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 intersections and containment for Phaser geometry shapes?

To check Phaser geometry intersections and containment, use the Phaser.Geom helpers to test overlap between Rectangle, Circle, Triangle, and Polygon objects for collision logic and UI hit testing without rendering.

What Phaser math utilities are available for distance and vector calculations?

Phaser.Math utilities provide functions for distance, angle, interpolation, snapping, random generation, and vector operations to support gameplay calculations and distance-based triggers in your game.

Can I use Phaser geometry classes for pure data shapes without rendering them?

Yes, Phaser geometry classes like Circle, Ellipse, Rectangle, Line, Polygon, and Triangle are designed as pure data shapes for quick geometric computations and tests, completely independent of the rendering pipeline.

What is the best way to prototype pathfinding triggers in Phaser 4?

The best way to prototype pathfinding triggers in Phaser 4 is combining Phaser.Geom data shapes for boundaries with Phaser.Math utilities for distance and angle calculations to evaluate spatial relationships efficiently.

Does Phaser 4 provide built-in helpers for triangle and rectangle intersections?

Yes, Phaser 4 provides built-in intersection helpers within Phaser.Geom that calculate overlaps and crossing points between core shapes like Triangles and Rectangles to support collision detection.