groups-and-containers

Coordinate Phaser 4 game objects using Groups and Containers for pooling and transform inheritance.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Organize and optimize Phaser 4 game objects by using Groups for logical collection and Containers for visual hierarchies, enabling pooling, batching, and nested transforms.

Core Features & Use Cases

  • Logical vs visual grouping: Groups for non-transformable collections, Containers for transform inheritance and composite UI.
  • Object pooling and batch operations: Efficiently reuse objects and perform batch updates across many children.
  • Layered rendering and nested structures: Use Layers to control render order and nest Containers within Layers for complex scenes.
  • Real-world use: Manage enemies, UI clusters, and scene entities with scalable, reusable patterns.

Quick Start

Create a Group and a Container in a Scene's create() method to start organizing objects and apply hierarchical transforms.

Frequently Asked Questions about groups-and-containers

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

FAQPage Schema
How do I organize and optimize Phaser 4 game objects for pooling and transforms?

Organize Phaser 4 game objects by using Groups for logical collections and Containers for visual hierarchies. This approach enables object pooling, batch updates, and nested transform inheritance across scene entities.

What is the difference between Groups and Containers in Phaser 4?

Groups in Phaser 4 provide non-transformable logical collections for object pooling and batch operations. Containers handle visual hierarchies, allowing child objects to inherit transforms for composite UI and nested scene structures.

How do I pool enemies and manage HUD elements in Phaser 4?

Pool enemies by grouping them in a Phaser 4 Group for efficient reuse, and manage HUD elements by placing them in a Container for transform inheritance. This pattern scales reusable object management across complex game scenes.

Can I nest Containers within Layers to control render order in Phaser 4?

Yes, you can nest Containers within Layers to control render order and build complex scenes in Phaser 4. Layers manage the rendering sequence, while nested Containers handle hierarchical transforms and composite UI structures.

When should I not use a Container for grouping game objects in Phaser 4?

Avoid using a Container when you only need logical grouping without transform inheritance. For non-transformable collections and simple object pooling, a Phaser 4 Group is more appropriate and avoids unnecessary hierarchical overhead.