groups-and-containers

Organizes Phaser 4 game objects using Groups, Containers, and Layers with pooling and transforms.

2|10|Updated Jul 28, 2026
One-click install
npx skills add https://github.com/kodingvibes/gamejam-2026 --skill groups-and-containers-kodingvibes
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: groups-and-containers
Source: https://github.com/kodingvibes/gamejam-2026/tree/main/participantes/jpyunism/.agents/skills/groups-and-containers
Command: npx skills add https://github.com/kodingvibes/gamejam-2026 --skill groups-and-containers-kodingvibes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Phaser 4 developers often struggle to choose between Groups, Containers, and Layers when organizing game objects, leading to broken transforms, failed object pooling, or incorrect render ordering. ## Core Features & Use Cases - Group Management and Object Pooling: Create logical collections with getFirstDead, killAndHide, and maxSize for reusable bullets, enemies, and coins. - Container Nested Transforms: Build composite UI elements like HUDs and inventory slots where children inherit position, rotation, scale, and alpha. - Layer Render Ordering: Control draw order and apply shared alpha, blend modes, and masks across batches of objects. - Use Case: When building a shooter, use a physics Group with pooling for bullets, a Container pinned with setScrollFactor(0) for the HUD, and Layers to separate background, entities, and UI. ## Quick Start Ask the AI to show how to create a pooled bullet group and a HUD container in a Phaser 4 scene.

Frequently Asked Questions about groups-and-containers

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

FAQPage Schema
How do I implement object pooling in Phaser 4?▼

Create a Group with a maxSize and classType, then use group.get(x, y) or getFirstDead(true) to reuse inactive members. Deactivate objects with killAndHide instead of destroying them so they stay available for reuse.

What is the difference between Group and Container in Phaser?▼

A Group is a logical collection with no transform, ideal for pooling and physics. A Container is a display list object whose children inherit position, rotation, scale, and alpha, suited for composite UI elements.

Does Phaser Container support physics bodies on children?▼

Physics on Container children is problematic. If the Container is not at position (0,0), child physics bodies will be offset incorrectly, so avoid combining Arcade Physics bodies with Container children.

Why is my Phaser Container not responding to input events?▼

Containers have no implicit size, so setInteractive fails without a hit area. Call container.setSize(width, height) before setInteractive() to define the clickable region.

When should I use a Layer instead of a Group in Phaser?▼

Use a Layer when you only need render-order control and shared alpha, blend mode, or mask across objects. Layers have no position, scale, or rotation and are lighter than Containers for pure depth bucketing.