Skip to content

Phaser Games

  • Home
  • Tutorials
    • Phaser 3
    • Basics
    • Intermediate
    • Advanced
    • Games
    • Set Up Phaser 3 Project Template
  • Resources/Tools
    • Getting Started
    • List Of Resources
    • Phaser 3 Text Designer Tool
  • Snippets
    • Phaser 3 Snippets
      • Phaser 3 Starter Snippets
      • Phaser 3 Sprite Snippets
      • Phaser 3 Time Snippets
      • Phaser 3 Tween Snippets
      • Phaser 3 Animation Snippets
      • Phaser 3 Physics Snippets
      • Phaser 3 TileMap Snippets
    • Phaser CE Snippets
      • Phaser Starter Snippets
      • Phaser Sprite Snippets
      • Phaser Physics Snippets
      • Phaser Button Snippets
      • Phaser Text snippets
      • Phaser Tween Snippets
      • Phaser Sounds Snippets
      • Phaser Game Snippets
      • Phaser Snippets Miscellaneous
      • Phaser MVC Snippets
      • Phaser Class Snippets
  • Shop & Freebies
  • Purchase History
  • Contact
destroy object on click

How Do I Remove an object on click?

Leave a Comment / Q&A / By William

How can you destroy an object on click in Phaser 3? What if you have many objects on the stage? With this code, the object clicked gets passed to the function and destroyed

dispatching events

Phaser 3 Dispatching Custom Events

Leave a Comment / Phaser 3 / By William

One of the most useful features of Flash/Actionscript was the ability to dispatch custom events. Phaser does have an event class built-in and with a little ES5 magic, we can easily create a global messaging system. This post is part of a series of building a platform game in Phaser 3. You can find the …

Phaser 3 Dispatching Custom Events Read More »

NES Controller

Phaser 3 Nintendo style controller

3 Comments / Phaser 3 / By William

I’m sure that some of you may be nostalgic for the days of youth when the Nintendo NES was the most popular game system on the planet. My first video game was pong, which was followed quickly by the Atari 2600. I saw the Nintendo controller a bit of a breakout. The way it was …

Phaser 3 Nintendo style controller Read More »

bounding box

Phaser 3 bounding box size with Arcade Physics

Leave a Comment / Phaser 3 / By William

intro The Problem Sometimes, the bounding box of the hit area is not the size that we need. This can cause problems with collisions. In the example below, even if the ninja was able to dodge an obstacle, without such a big hit area (shown in purple around the ninja), the player is sure to …

Phaser 3 bounding box size with Arcade Physics Read More »

phaser 3 camera

Phaser 3 Make the camera follow the player

Leave a Comment / Phaser 3 / By William

When I was building virtual worlds in Flash/As3 it took quite a bit of maths to make the background scroll. And then to scroll only when the avatar wasn’t near the edge of the world. Phaser’s built-in camera class makes this all very easy and quick. This code continues to build on the code we …

Phaser 3 Make the camera follow the player Read More »

Platform Games in Phaser 3 – Setting Up

Leave a Comment / Phaser 3 / By William

Platform games have been a staple in video games since Mario Brothers came along in the early 80’s. Because the framework gives us a lot of code to work with, setting Up Phaser 3 platform games isn’t too difficult. There are a lot of 3rd party tools to help you do this, but I’m going …

Platform Games in Phaser 3 – Setting Up Read More »

JSON Animations in Phaser 3

Leave a Comment / Phaser 3 / By William

When animations contain a lot of images and have a lot of animations it is easier to use JSON Animations. This is an update from my old Phaser 2 post. Software The software I use to create animations is called Texture Packer. They have both paid and free versions. You’ll only need the free version …

JSON Animations in Phaser 3 Read More »

Make a Jump Meter in Phaser 3

Leave a Comment / Phaser 3 / By William

In the last post, I showed how you can use gravity and velocity together to make a sprite jump. In this post, we will add a jump meter to the project to show the user just how much power they will use. This project uses the Utility Template. Making the meter image The first thing …

Make a Jump Meter in Phaser 3 Read More »

How to Jump In Phaser 3

Leave a Comment / Phaser 3 / By William

In last week’s post, we explored how to use gravity in Phaser 3. Now we will defy that gravity and make the ball jump. We can do this by setting the velocity of the ball to counteract the gravity. So far in the code, we’ve set up a ball that falls until it collides against …

How to Jump In Phaser 3 Read More »

Using Gravity in Phaser 3

Leave a Comment / Phaser 3 / By William

Making objects hit the ground One of the great things about Phaser is the physics engines that you can use with it. In this post, I’ll show you how to use gravity on an an object. I’ll be using the Utility template to set this up. Although we don’t need any of the features for …

Using Gravity in Phaser 3 Read More »

Posts navigation
← Previous Page 1 2 3 … 8 Next Page →

Phaser Snippers

  • Phaser 2 Snippets
  • Phaser 3 Snippets

Guides

  • Learn JavaScript Classes in 10 minutes
  • Phaser 3 Basics – Images, Text and Click
  • Set Up Phaser 3 Project Template
  • Scaling in Phaser 3
  • Dispatching Custom Events
  • Change image when clicked
  • Extend a sprite in Phaser 3
  • Image anchors

Affordable Game Assets

Subscribe for Updates!

JavaScript For Beginners – Free Course

Join The FaceBook Group

Facebook Group

Create and Publish HTML5 Games in 24 Hours

Create and Publish HTML5 Games in 24 Hours

Recent Posts

  • Loading TIleMaps in Phaser 3 and JSON
  • How to use Phaser 3 TileMaps
  • Floating in Phaser 3
  • How to make a health bar in Phaser 3
  • How to flip a sprite in Phaser 3
Copyright © 2023 Phaser Games | Powered by Astra WordPress Theme