geometry-and-math

Provide Phaser 4 geometry and math utilities for spatial reasoning.

1|Updated May 3, 2026
One-click install
npx skills add https://github.com/WanderTheWeeb/papas_trauma --skill geometry-and-math-wandertheweeb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: geometry-and-math
Source: https://github.com/WanderTheWeeb/papas_trauma/tree/main/skills/geometry-and-math
Command: npx skills add https://github.com/WanderTheWeeb/papas_trauma --skill geometry-and-math-wandertheweeb

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

You need reliable Phaser 4 geometry objects and Math utilities for spatial logic (containment, intersections, and numeric helpers) without reinventing math or geometry primitives.

Core Features & Use Cases

  • Geometry (Geom) objects: Use data-only shapes like Circle, Rectangle, Line, Polygon, Triangle, and Ellipse for calculations such as contains, getPoint(s), getRandomPoint, and property updates via shared instance methods.
  • Intersection testing: Run boolean Phaser.Geom.Intersects.*To* checks and optionally use Get* variants to obtain intersection points for collision/overlap logic.
  • Phaser Math utilities: Work with Phaser.Math.Vector2/Vector3/Matrix4, angles, distances, interpolation, easing, random generation (seeded), fuzzy comparisons, clamping, wrapping, and snapping.

Quick Start

Use geometry-and-math to test whether a Circle overlaps a Rectangle and compute the distance and angle between two points in Phaser 4.

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 Phaser Circle overlaps a Rectangle for collision detection?

To check Phaser collision detection, use the boolean Phaser.Geom.Intersects.CircleToRectangle helper to test overlap, or use the GetCircleToRectangle variant to obtain exact intersection points for overlap logic.

Does Phaser 4 provide built-in math utilities for distance and angle calculations?

Phaser 4 provides built-in math utilities for distance and angle calculations through Phaser.Math functions, enabling direct spatial reasoning and numeric helper operations between Vector2 points.

Can I generate deterministic random numbers in Phaser for seeded gameplay behavior?

You can generate deterministic random numbers in Phaser using the seeded random generation functions within Phaser.Math, ensuring reproducible math-driven behavior across gameplay systems.

What is the best way to test shape containment in Phaser 4 geometry?

The best way to test shape containment in Phaser 4 geometry is using data-only Geom objects like Circle, Rectangle, and Polygon, which provide instance methods such as contains for spatial reasoning checks.

How do I perform geometric path sampling and get random points in a Phaser Polygon?

To perform geometric path sampling in a Phaser Polygon, use the shared instance methods getPoint and getPoints, or call getRandomPoint to retrieve arbitrary coordinates within the shape boundaries.

What Phaser math operations support clamping, wrapping, and snapping values?

Phaser Math supports clamping, wrapping, and snapping values through dedicated Phaser.Math functions, alongside interpolation, easing, and fuzzy comparisons for precise numeric control in game logic.