Category: Game Development
Callback for Specific Animation Completion Event in Phaser 3
In Phaser 3, you can define animation for a sprite. It is possible that you want to know when the animation will be completed. Phaser 3 provides a rich set of callback functions including animation completion event. If there is only a single animation defined for a sprite, you can use any of the following…
Phaser 3 Sprite Shows Black Rectangle
I am working on creating an HTML mobile game using Phaser 3. So far, I have used sprites and images in multiple games that I have developed so far. Today when I added sprite and was testing on Android mobile device, it did not show the sprite. Instead, it showed up as black rectangle. Initially…
Convert ogg(/mp3/m4a) Files to m4a(/ogg/mp3) Files Using DOS Command/ Batch Files
If you have a need to convert multiple *.ogg files into *.m4a files, it is not easily possible. I have found a way to quickly convert all ogg files into m4a files. In fact, you can convert any audio file formats to any other format using a DOS bat file. Prerequisite You should have ffmpeg…
How to Use Phaser 3 Group With Atlas Images of Different Sizes?
Phaser 3 is a really nice HTML 5 game development framework. If you know JavaScript or Typescript, it is a really easy framework to quickly create nice HTML 5 games. This is also a solid alternative to iPhone or android game development. If you are a Web developer, you don’t want to learn a new…
Phaser 3 Example: Set Gravity And Stop Object From Moving When Clicked
In Phaser 3, we can set gravity for an object to make it falling for floating. I am working on a project where I want to set the gravity but when I click on it, the object should stop moving. Here is a working example of a scene. As you would notice, body.stop(), and body.allowGravity…
Stretch Background Image to Cover Entire Area in Phaser 3
If you have a background image and want to stretch it so that entire canvas area is covered, here is a sample code written in Typescript.
Starting a New Scene is Not Working in Phaser 3
You started working on creating a game with Phaser and added couple of scenes. So far your game is working as expected. Now you added one more scene using following code. But somehow you don’t see this scene in your game. You can only see a background. Even though you have copied the code, validated…