Most Phaser game tutorials open the same way: install Node, clone the starter, read the docs, copy the boilerplate, run a build script, see a black screen, fix the build script, see a sprite. The fastest path in 2026 skips every step before "playable build". You open WizardGenie in a browser tab, describe the game in one paragraph, and the agent writes a working Phaser 4 project, render loop, scenes, input, physics, asset loaders, in a single round-trip. The build runs in the same tab. You spend your time on the game, not the toolchain.
The full Phaser game tutorial workflow in five steps
Every step in this Phaser game tutorial happens inside one browser tab. No editor download, no project template, no per-platform quirks to learn. The five steps in order:
- Open WizardGenie and pick the model the agent will run on. Frontier reasoners like Claude Opus 4.7 and GPT-5.5 produce the cleanest one-shot Phaser 4 scaffolds.
- Describe the game in one paragraph. Genre, player verbs, world layout, win condition, scope, art style. The agent writes a full Phaser 4 project: scenes, input, physics, asset loaders, sample level.
- Run the build in the side preview pane. The first run is rough. Placeholder sprites, the occasional collider glitch. The point is to confirm the game loop exists.
- Iterate by chat. "Increase gravity, the jump feels floaty." "Slimes are walking through walls, add collider." "Add a second level with vertical scrolling." Each round-trip is a couple of seconds on a cheap executor model.
- Swap in real assets without leaving the tab. Quick Sprites for the player and enemy sprite sheets, Tileset Forge for level tiles, SFX Gen for jumps and pickups, Music Gen for the level loop.
Total time to a playable first build is usually five to ten minutes. A small two-level browser game with real art and music lands in roughly an afternoon. What comes after, pacing, balance, hit-feel, polish, is the part where you stop typing prompts and start playing the build.
What is Phaser, and why Phaser 4 changes the math
Before talking to the agent, it helps to know what Phaser is. Phaser is a free, open-source HTML5 game framework that was first released in April 2013 by Richard Davey. It renders with WebGL (and falls back to Canvas), exposes a clean scene + sprite + physics API in JavaScript or TypeScript, and runs in any modern browser tab. It is one of the most-starred game frameworks on GitHub and powers a long tail of indie browser games, web ads, jam entries, and educational tools.
For most of the last decade, Phaser 3 has been the default. That changed this April. Phaser 4.0.0 shipped on April 10, 2026, and 4.1.0 followed on April 30, 2026. Verified against the GitHub release tags on May 15, 2026. The numbers behind the version bump are the interesting part:
- Render node architecture. The v3 pipeline system is gone, replaced with a cleaner node-based renderer. The same API draws faster and the engine is easier to extend.
- Unified filter system. FX and masks collapse into one system with 13+ built-in filters. Bloom, blur, vignette, glitch, the usual suspects, all one API call.
- SpriteGPULayer. Up to a million sprites in a single draw call, around 100 times faster than the standard sprite path. Bullet-hell games and particle storms get cheap.
- TilemapGPULayer. Entire tilemap layers as single quads, up to 4096 by 4096 tiles. Big worlds without the per-tile overhead.
- New game objects. Gradient, Noise, CaptureFrame, and Stamp ship as first-class objects. Procedural backgrounds and screenshot effects without custom shaders.
- Improved lighting. Simplified lighting API with self-shadows; works on most game objects, not just sprites.
The practical takeaway: new browser-game projects in 2026 should be born on Phaser 4. Phaser 3.86 still works and has more Stack Overflow answers, but every new feature in this list raises the ceiling on what a browser game can be. When you talk to the WizardGenie agent, ask for Phaser 4 by name in the first prompt. The agent will scaffold a 4.x project and use the new APIs.
Step 1: Open WizardGenie and pick the model
Inside the WizardGenie web app, the agent is driven by an AI coding model you pick from a dropdown. The current lineup, verified against the model picker source on May 15, 2026, is eight models: Claude Opus 4.7, Claude Sonnet 4.6, GPT-5.5, Gemini 3.1 Pro, DeepSeek V4 Pro, Kimi K2.5, Grok 4.2, and MiniMax M2.7. Prices and quality span roughly two orders of magnitude. The right pick depends on the kind of turn you are taking:
- First prompt (one-shot scaffold). The single most important decision in the project. A frontier reasoner like Claude Opus 4.7 or GPT-5.5 produces the cleanest Phaser 4 scaffold in one pass. Worth the cost for the moment that defines the whole project.
- Iterative turns (tuning, content, fixes). Switch to a cheap executor. DeepSeek V4 Pro, Kimi K2.5, MiniMax M2.7, and Gemini 3.1 Flash run dramatically less per token and fast enough that the chat loop feels real-time.
- Big architectural moves. "Refactor this into a proper component system" or "split this into a multi-scene state machine" earns one frontier-reasoner turn, then drop straight back to a cheap executor.
If you have read Best AI Model for Coding, the rule is the same one: never put a frontier-priced model on the typing side of a Planner+Executor pair. The economics collapse. A Sonnet-4.6-on-the-typing-side Phaser project costs roughly five times what the same project costs on a DeepSeek-V4-Pro executor with an Opus 4.7 planner, with no measurable quality gain on tuning-heavy work.
Step 2: Write the first prompt that defines the whole game
The first prompt is the most important decision in this Phaser game tutorial. A good first prompt locks the genre, the core verbs, the world layout, the visual style, the engine version, and the scope in one paragraph. A bad first prompt produces a generic Phaser starter the agent then spends an hour reshaping into your idea.
The shape that works for a side-scrolling Phaser browser game:
Make a 2D side-scrolling browser game in Phaser 4. The player is a small
wizard who walks left and right with the arrow keys and jumps with
spacebar. Three levels of increasing length, side-scrolling camera that
follows the wizard. Each level has slime enemies that walk a fixed patrol
path and damage the wizard on contact, coins to collect, and a goal flag
at the right edge. Pixel-art look, 32x32 tiles, 48x48 wizard sprite.
Variable jump height (hold spacebar for higher), coyote time of about
100ms, jump buffering of about 100ms. Three hearts of health, 1-second
invulnerability after each hit. Use Vite as the build tool and target
Phaser 4.x. Make it actually playable, not just a render loop.
Notice what is in there: genre, engine version, exact input bindings, enemy behavior, pickups, win condition, scope (three levels), visual style (pixel art with explicit tile and sprite sizes), feel parameters (variable jump, coyote time, jump buffering), HP system, build tool (Vite), and "actually playable" as a tag to nudge the agent into wiring up a real game-over state instead of stopping at a render loop. What is not in there: file structure, framework version pinning, dependency lists. The agent handles all of that.
Resist the temptation to micromanage. The first prompt should describe the game; the iteration prompts will fix the details. Sending a 600-word spec on the first turn produces a worse scaffold than a 150-word one, because the agent gets confused about which constraints are load-bearing.
Step 3: Run the build and read the file tree the agent produced
About thirty to ninety seconds after sending the prompt, the agent returns a file tree. A typical Phaser 4 project from the agent looks like this:
index.html
package.json
vite.config.js
src/
main.js
scenes/
BootScene.js
Level1Scene.js
Level2Scene.js
Level3Scene.js
HudScene.js
objects/
Wizard.js
Slime.js
Coin.js
assets/
placeholder-wizard.png
placeholder-slime.png
placeholder-tiles.png
level-1.json
level-2.json
level-3.json
Five things worth understanding about this layout, because they map to vocabulary you will use when iterating:
main.jscreates the Phaser game. It callsnew Phaser.Game(config)with a scene list, a physics setup, and the canvas size. You almost never edit this file by hand; you ask the agent to "add a new scene to the list" or "set the physics gravity globally" and it editsmain.jsfor you.- Scenes are screens.
BootScene.jsloads assets and hands off toLevel1Scene.js, which builds the playable level.HudScene.jsdraws the heart counter and score on top of the level scene. The standard Phaser pattern is one scene per logical screen, and a HUD scene running in parallel. - Game objects are classes.
Wizard.jsextendsPhaser.Physics.Arcade.Sprite. Movement, jump, health, animation state all live there. Edits to "how the wizard feels" land in this file. - Tilemaps are JSON. The levels are JSON tilemaps the agent generated. You can edit them by chat ("add three floating platforms above the chest in level 1") or by exporting them to a tile editor like Tiled and round-tripping if you prefer hand-crafted level design.
- Assets are placeholders. The placeholder PNGs are throwaway. Step 5 swaps them for real Sorceress assets.
Resist the urge to read every file. Hit Run instead. WizardGenie launches the project in a side preview pane and the wizard is probably a colored square, the slimes might tunnel through walls, the camera might lag. That is all normal. Confirm the loop runs, then go straight into iteration.