game-setup-and-config

Initialize and configure Phaser 4 game instances with renderer, scaling, and boot settings.

40.1k|7.2k|Updated Apr 12, 2013
One-click install
npx skills add https://github.com/phaserjs/phaser --skill game-setup-and-config-phaserjs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: game-setup-and-config
Source: https://github.com/phaserjs/phaser/tree/main/skills/game-setup-and-config
Command: npx skills add https://github.com/phaserjs/phaser --skill game-setup-and-config-phaserjs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide helps developers bootstrap a Phaser 4 game by selecting a renderer, configuring GameConfig, and wiring up the initial scene.

Core Features & Use Cases

  • Provides a comprehensive guide to creating a new Phaser.Game with sensible defaults and the ability to override top-level and nested config properties.
  • Documents renderer options (AUTO, CANVAS, WEBGL, HEADLESS), scale modes, and common Boot/Pre-Boot sequences for predictable startup across projects.
  • Useful for onboarding new Phaser projects, refactoring existing game initialization code, or aligning team conventions around GameConfig usage.

Quick Start

Create a new Phaser.Game with a minimal, well-structured GameConfig that selects an appropriate renderer, sets a canvas size, and includes a default scene to boot.

Frequently Asked Questions about game-setup-and-config

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

FAQPage Schema
How do I configure a new Phaser game instance with the correct renderer and scaling?

To configure a Phaser game, create a new Phaser.Game instance with a well-structured GameConfig. This config selects an appropriate renderer like AUTO or WEBGL, sets the canvas size, and includes a default scene to boot.

What renderer options are available when setting up a Phaser game?

Phaser game setup supports four renderer options: AUTO, CANVAS, WEBGL, and HEADLESS. Choosing the right renderer in your GameConfig ensures predictable startup and optimal rendering performance across different project structures.

How do I optimize pixel art and FPS settings in my Phaser game config?

Optimize pixel art and FPS by adjusting nested GameConfig properties during initialization. Configuring these core rendering options alongside scale modes ensures crisp visuals and consistent frame rates across your project.

What is the Phaser boot sequence and how do I handle lifecycle events?

The Phaser boot sequence manages predictable startup via Pre-Boot and Boot phases. Handling these lifecycle events in your GameConfig ensures proper initialization of scenes and rendering before the game starts.

Can I override default GameConfig properties when creating a Phaser game?

Yes, you can override both top-level and nested GameConfig properties when creating a Phaser.Game. This allows you to apply sensible defaults while customizing renderer, scale modes, and boot settings for your project.