phaserjs avatar

Game Setup And Config

This walks you through spinning up a Phaser 4 game instance with the GameConfig object, which is more involved than you'd think. Covers renderer selection (AUTO, WEBGL, CANVAS), pixel art setup with proper antialiasing flags, FPS limits, canvas insertion, and the full boot sequence from DOMContentLoaded through the game loop. The pixel art patterns alone are worth having on hand since getting crisp pixels at scale requires specific combinations of antialias, antialiasGL, and roundPixels. Also useful for understanding why your transparent canvas isn't working or why your custom FPS target isn't kicking in. The config precedence rules between top-level and nested properties can bite you if you're not careful.

skills.sh installs
1.4K
GitHub stars
40.7K
last updated
Aug 21, 2026

Install

$ npx -y skills add phaserjs/phaser --skill game-setup-and-config --agent claude-code

Installs into .claude/skills of the current project.

Files

Game Setup and Config

How to create a Phaser.Game instance with the right GameConfig options for renderer, scaling, pixel art, FPS, and canvas placement.

Key source paths: src/core/Game.js, src/core/Config.js, src/core/typedefs/GameConfig.js, src/const.js, src/scale/const/ Related skills: ../scenes/SKILL.md, ../loading-assets/SKILL.md, ../scale-and-responsive/SKILL.md

Quick Start

The simplest possible Phaser 4 game -- a single scene with the default 1024×768 canvas:

class MyScene extends Phaser.Scene {
    preload() {
        this.load.image('logo', 'assets/logo.png');
    }

    create() {
        this.add.image(400, 300, 'logo');
    }
}

const config = {
    type: Phaser.AUTO,
    scene: MyScene
};

const game = new Phaser.Game(config);

new Phaser.Game(config) triggers the entire boot sequence: config parsing (Config), renderer creation, DOM insertion, and the game loop (TimeStep). The game waits for DOMContentLoaded before booting.

Core Concepts

Boot Sequence (src/core/Game.js)

Sponsors

Details

Repository
github.com/phaserjs/phaser
Categories
Sales & Marketing, Game Development
First seen
Jun 3, 2026

More from phaserjs/phaser

All 8
1anthropics avatarcustomer-pulseanthropics/knowledge-work-pluginsAggregates PayPal disputes, HubSpot feedback and tickets, and email sentiment (plus pasted or exported Google/Yelp reviews) into a themes report with verbatim e1.3Kskills.sh installs
2cxuu avatargo-lintingcxuu/golang-skillsUse when setting up linting for a Go project, configuring golangci-lint, or adding Go checks to a CI/CD pipeline. Also use when starting a new Go project and de1.3Kskills.sh installs
3martinholovsky avatarwindows-ui-automationmartinholovsky/claude-skills-generatorExpert in Windows UI Automation (UIA) and Win32 APIs for desktop automation. Specializes in accessible, secure automation of Windows applications including elem1.3Kskills.sh installs
4anthropics avatarcustomer-pulse-checkanthropics/knowledge-work-pluginsSynthesizes themes from PayPal disputes, HubSpot tickets, and review exports into a top-3 fixable issues list with drafted response templates. Accepts optional 1.3Kskills.sh installs
5quodsoler avatarue-character-movementquodsoler/unreal-engine-skillsUse this skill when working with character movement, CharacterMovementComponent, CMC, movement modes, walking, falling, swimming, flying, custom movement, netwo1.3Kskills.sh installs
6ognjengt avatarcro-optimizationognjengt/founder-skillsAnalyzes landing pages and provides detailed CRO (Conversion Rate Optimization) recommendations. Use when user provides a landing page URL or HTML/CSS code and 1.3Kskills.sh installs