groups-and-containers

Manage and organize Phaser 4 game objects using Groups, Containers, and Layers.

3|Updated Apr 18, 2026
One-click install
npx skills add https://github.com/Autinhorse/levelcraft --skill groups-and-containers-autinhorse
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: groups-and-containers
Source: https://github.com/Autinhorse/levelcraft/tree/main/games/docs/phaser-skills/groups-and-containers
Command: npx skills add https://github.com/Autinhorse/levelcraft --skill groups-and-containers-autinhorse

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the management and organization of multiple game objects by utilizing Groups and Containers, simplifying scene setup and object interactions.

Core Features & Use Cases

  • Grouping objects for logical management, such as enemies or bullets, with easy pooling and batch operations.
  • Creating visual hierarchies with Containers that inherit position, rotation, and scale, useful for UI elements or clustered objects.
  • Controlling rendering layers using Layers to manage draw order and shared effects within complex scenes.
  • Use Case: Arrange a HUD with health bars and icons using Container, pool enemies efficiently with Group, and control scene rendering order with Layer.

Quick Start

Use the groups-and-containers skill to organize game objects and optimize rendering performance during scene setup.

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 better scene structure?

Use Groups for logical management and pooling of objects like enemies or bullets, enabling batch operations to streamline scene setup and object interactions efficiently.

What is the difference between Groups and Containers in Phaser?

Layers control rendering draw order and shared effects within complex scenes. Use Containers for UI elements, Groups for pooling enemies, and Layers to manage scene rendering order.

How do I set up object pooling for bullets and enemies in Phaser 4?

This approach prevents constant object creation and destruction overhead during gameplay, keeping your scene setup performant when managing large numbers of entities.

Can I use Containers to create nested transforms for UI elements in Phaser?

This nested transform behavior is useful for arranging clustered objects like a HUD with health bars and icons, ensuring the entire interface moves and scales together.

Does Phaser 4 support layer-based rendering to control draw order?

Layers operate independently of the logical object hierarchy, allowing you to separate visual rendering order from object grouping and container transforms during scene setup.

When should I not use Containers for game object management in Phaser?

For pooling bullets or enemies, use Groups instead. Containers add transform overhead, so reserve them for UI elements or clustered objects requiring inherited position and scale.