Phaser Tutorial
Learn Phaser step by step: 36 lessons in 9 chapters with examples, quizzes, diagrams and projects.
Start learning →
of lessons completed
Getting Started
- What Is Phaser? A Tour of the HTML5 Game Framework Learn what the Phaser game framework is, what it gives you, how a game is organized into scenes and game objects, and run your first live Phaser example.
- Your First Phaser Game: Setup, Scene and Click Target Build your first complete Phaser game: the HTML page, loading Phaser from a CDN, a scene class, a score, a timer and a click target. Runs live in the browser.
- The Phaser Game Configuration Explained Understand every important Phaser game config option: renderer type, size, parent, background, scale modes, pixel art, FPS, physics and scenes, with live examples.
- Phaser with Vite and npm: A Real Project Setup Set up a professional Phaser project with npm and Vite: folder layout, ES modules, scene files, the dev server, TypeScript option and a production build.
Game Loop and Scenes
- Phaser Scenes and the Scene Lifecycle Learn how a Phaser scene starts and ends: init, preload, create and update, the scene keys, scene events, shutdown cleanup and how to restart a scene safely.
- The Phaser Game Loop and Delta Time Understand the Phaser game loop, update(time, delta), frame-rate independent movement, FPS display, slow motion with time scale and fixed timesteps, with live demos.
- Loading Assets in Phaser: Images, Audio, JSON and Textures Learn the Phaser Loader: preload, texture keys, load.image, spritesheet, audio, JSON and atlas, a progress bar, loading errors and drawing textures in code.
- Working with Multiple Scenes in Phaser Split a Phaser game into menu, play, HUD and pause scenes. Learn scene.start, launch, pause, resume, stop, passing data, the registry and scene-to-scene events.
Sprites and Animation
- Phaser Shapes, Text and Graphics Objects Draw with Phaser game objects: rectangles, circles, stars, lines, the Graphics API, styled and wrapped text, plus the shared properties every game object has.
- Phaser Images and Sprites: Origin, Flip, Tint and Depth Learn the difference between Phaser images and sprites and how to position, scale, rotate, flip, tint, crop and layer them, with live examples you can edit.
- Phaser Spritesheets and Frame Animation Animate Phaser sprites: spritesheets and atlases, frames, anims.create, generateFrameNumbers, frame rate, repeat, yoyo, animation events and chaining, with live demos.
- Phaser Tweens: Easing, Chains, Stagger and Counters Animate any property smoothly with Phaser tweens: duration, easing, delay, yoyo, repeat, callbacks, tweens.chain, stagger and counters, with runnable examples.
- Phaser Containers, Groups and Particle Emitters Organize many game objects in Phaser: move them together with containers, manage collections with groups and object pools, and make effects with particle emitters.
Input and Physics
- Phaser Keyboard Input: Cursors, WASD, Key Events Handle the keyboard in Phaser: cursor keys, WASD, addKey and addKeys, isDown, JustDown, key events, combos, cooldown shooting and focus tips, with live examples.
- Phaser Pointer Input: Mouse, Touch, Drag and Drop Handle mouse and touch in Phaser: pointer events, setInteractive and hit areas, hover, dragging, drop zones, multi-touch, swipes and a drawing demo with live code.
- Phaser Arcade Physics Basics: Gravity, Velocity and Bodies Learn Arcade Physics in Phaser: enabling it, bodies, gravity, velocity, acceleration, drag, bounce, world bounds, body size and offset, static bodies and the debug view.
- Phaser Collisions, Overlaps and Physics Groups Detect and respond to hits in Phaser Arcade Physics: colliders versus overlaps, callbacks, physics groups, static groups, process callbacks, one-way platforms and pickups.
- Phaser Platformer Movement: Running, Jumping, Coyote Time Build responsive platformer movement in Phaser: gravity, running, onFloor jumps, variable jump height, coyote time, jump buffering, one-way platforms and animation states.
Tilemaps and Cameras
- Tilemap Basics Build tile-based worlds in Phaser with tilemaps, tilesets and layers. Create a map from an array, read and change tiles, and paint tiles with the mouse.
- Maps from the Tiled Editor Design levels in Tiled and load them into Phaser. Learn the Tiled JSON format, tile properties, multiple layers and object layers for spawn points.
- Tile Collision and Interactions Make tilemap layers solid in Phaser Arcade Physics. Use setCollision, collision by property, tile callbacks for hazards and pickups, and debug drawing.
- Camera Basics Learn how Phaser cameras work. Scroll a large world, follow a player with smoothing and a deadzone, set bounds, zoom, and build parallax and fixed HUD layers.
- Camera Effects and Multiple Cameras Add fade, flash, shake, pan and zoom camera effects in Phaser, then use extra cameras for a minimap, a fixed UI layer and split-screen views.
Audio and UI
- Audio Basics Play sound effects and music in Phaser. Learn the sound manager, pitch and volume control, audio sprites, mute and the browser autoplay lock.
- Text and Buttons Style text in Phaser with fonts, strokes, shadows and word wrap, then build reusable buttons, toggles and sliders with interactive containers.
- HUDs, Menus and Pause Screens Build a HUD and menus in Phaser using separate UI scenes: score and health bar, a title menu, pause and resume, and data passing between scenes.
Game Architecture
- Scene Architecture Structure a Phaser game with boot, preloader, menu, gameplay and game over scenes. Learn the scene lifecycle, loading bars, cleanup and scene data.
- Custom Game Objects and Object Pools Organize Phaser code with custom classes that extend Sprite, give objects their own update logic and states, and reuse bullets with object pools.
- Events, Registry and Saving Decouple Phaser code with events, share state across scenes with the registry and data manager, and save progress safely with localStorage.
Packaging and Publishing
- Scale Manager and Mobile Make Phaser games fit any screen with the Scale Manager. Compare FIT, ENVELOP and RESIZE modes, handle fullscreen and orientation, and add touch controls.
- Vite, TypeScript and Project Structure Set up a real Phaser project with Vite and TypeScript: folder layout, typed scenes and events, a production build and testing game logic.
- Optimizing and Publishing Your Game Measure and improve Phaser performance with atlases, batching and pooling, then publish your game to itch.io, static hosts, portals, mobile and desktop.
Projects and Practice
- Project: A Platformer Game Build a complete Phaser platformer: a tile level from text, good jump feel, coins, patrolling enemies, spikes, lives, a goal flag and a following camera.
- Project: A Space Shooter Build a vertical space shooter in Phaser with bullet pools, enemy waves, particle explosions, power-ups, a starfield, a HUD scene and rising difficulty.
- Project: A Memory Match Game Build a memory card game in Phaser with a size menu, grid layout, flip animations, input locking, a timer, a star rating and best scores.
- Phaser Practice Challenges Ten Phaser practice challenges with hints and acceptance checks, plus runnable solutions for whack-a-mole and a tilemap treasure explorer.