geometry-and-math

Compute Phaser 4 geometry intersections and math utilities for shapes.

Updated Feb 11, 2026
One-click install
npx skills add https://github.com/ArtRiv/game-topicos-especiais --skill geometry-and-math-artriv
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: geometry-and-math
Source: https://github.com/ArtRiv/game-topicos-especiais/tree/main/skills/geometry-and-math
Command: npx skills add https://github.com/ArtRiv/game-topicos-especiais --skill geometry-and-math-artriv

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you work efficiently with Phaser 4 geometry shapes and math utilities so you can compute containment, intersections, and numeric transforms without reinventing formulas.

Core Features & Use Cases

  • Geometry shape utilities: Create and query data-only shapes such as Circle, Rectangle, Line, Polygon, Triangle, and Ellipse for point tests and perimeter sampling.
  • Intersection testing: Determine overlaps and intersections between shapes (Circle, Rectangle, Line, Triangle, Polygon) with boolean checks and “Get*” functions that return intersection points.
  • Math toolbelt for gameplay: Use Phaser.Math helpers for angles, distance, interpolation, easing, snapping, clamping, and seeded randomness for reproducible behavior.
  • Use case: Decide whether a projectile path intersects a target hitbox (rectangle), then compute intersection points to place effects precisely along the collision boundary.

Quick Start

Use the geometry-and-math Skill to compute whether a circle hitbox intersects a rectangle and to retrieve the intersection points you can feed into your rendering logic.

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 projectile line intersects a rectangle hitbox in Phaser?

To check projectile intersection in Phaser, use boolean intersection tests between Line and Rectangle shapes to detect overlaps, then call Get* functions to retrieve exact intersection points along the collision boundary.

What Phaser math helpers are available for gameplay calculations like distance and angles?

Phaser math helpers support distance measurements, radians-based angle calculations, interpolation, easing, snapping, clamping, and seeded randomness via RandomDataGenerator for deterministic and reproducible gameplay behavior.

Does this Phaser geometry utility support point containment queries for circles and polygons?

Yes, point containment queries are supported across data-only shapes including Circle, Rectangle, Triangle, Polygon, and Ellipse, allowing you to test whether specific coordinates fall inside defined geometric boundaries.

Can I use Phaser geometry shapes for perimeter sampling and random point generation?

Yes, you can sample perimeter points on shapes like circles and rectangles, and generate random points using Phaser's RandomDataGenerator with seeded values to ensure deterministic and reproducible random outputs.

What's the best way to detect collisions between multiple shape types in Phaser without writing custom formulas?

Use built-in intersection testing across Phaser geometry shapes including Circle, Rectangle, Line, Triangle, and Polygon to perform boolean overlap checks and retrieve precise intersection points without implementing custom math formulas.

Why use Phaser Geom instances instead of raw coordinates for gameplay collision detection?

Phaser Geom instances provide performant data-only shape objects that support containment queries, intersection testing, and perimeter sampling, enabling efficient collision checks and precise effect placement along collision boundaries.