groups-and-containers

Organize Phaser 4 game objects with Groups, Containers, and Layers.

Updated Apr 25, 2026
One-click install
npx skills add https://github.com/dzyamik/furry-match3 --skill groups-and-containers-dzyamik
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: groups-and-containers
Source: https://github.com/dzyamik/furry-match3/tree/main/.claude/skills/groups-and-containers
Command: npx skills add https://github.com/dzyamik/furry-match3 --skill groups-and-containers-dzyamik

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Groups and Containers in Phaser 4 are essential for organizing game objects, managing transforms, and controlling render order. They help you build modular, scalable scenes by grouping logic, reusing pools, and layering visuals without wrestling with individual object positions.

Core Features & Use Cases

  • Logical grouping with Group for pooling and non-visual collections.
  • Visual parent with inherited transforms via Container, enabling nested transforms and UI composition.
  • Layer-based render-order grouping to manage draw order and apply shared effects.
  • Object-pooling patterns, setExclusive behavior, and practical nesting strategies.

Quick Start

Create a Group and a Container in a Scene to organize objects, then place them in a Layer to control render order.

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 game objects in Phaser 4 for pooling and scene management?

Organize Phaser 4 game objects using Groups for non-visual collections and object pooling, Containers for nested transforms and UI composition, and Layers to control rendering order. This structure enables modular, scalable scene building without manually managing individual object positions.

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

Groups handle logical collections and object pooling without visual properties. Containers provide parent-child nested transforms for UI composition. Layers manage render order and apply shared visual effects. Each serves a distinct role in structuring enemies, UI elements, and dynamic scenes.

How do I set up object pooling with getFirstDead in Phaser 4?

Set up object pooling in Phaser 4 by creating a Group, adding inactive objects, and retrieving them with getFirstDead. This pattern reuses pooled game objects instead of instantiating new ones, optimizing memory and performance for dynamic scenes.

When should I use a Container instead of a Group in Phaser 4?

Use a Container in Phaser 4 when you need visual parent-child relationships with inherited, nested transforms for positioning UI elements. Use a Group for non-visual logical collections and pooling where inherited transforms are not required.

Why does setExclusive matter when adding objects to a Container in Phaser 4?

Applying setExclusive when adding objects to a Container in Phaser 4 ensures correct lifecycles and rendering. It restricts objects to a single container, preventing overlapping display list registrations that cause visual glitches and unpredictable transform behavior.

How do I control render order across multiple game objects in Phaser 4?

Control render order in Phaser 4 by placing game objects into a Layer using the add.layer API. Layers group objects specifically for draw order management and applying shared effects, separating visual rendering from logical grouping and transforms.