Skip to content

Tag: phaser-framework

Phaser3 framework javascript: current anims index

In phaser 3 framework, what syntax do I use to check the current frame index? I want to make a hit area appear only when the player’s sprite sheet reaches a certain index(the index displaying the motion of ‘attack’). I want to accomplish this through detecting its current frame index. How ca…

Moving the character a few tiles more seems to cause the whole scene (the physics world) to shake, why is that? How do I fix it?

Here is the example code from phaser3 tutorial. Per the tutorial, there are 2 scenes, one for the world map and the other for the battle. I doubt if the code above implement the battle scene. I assume the scene in question is the world scene. Moving (with arrow keys) the character one or two steps/tiles works…

How to handle collisions in Phaser

I want to make objects push away from each other in my Phaser game (arcade physics). To do so I’ve tried to use the collider function: But I always get TypeError: undefined is not an object (evaluating ‘t.isParent’) It looks like this is error rises during the update process as it’s ri…

How to detect overlap in Phaser.js?

I am new to Phaserjs, and I am trying to make a shooting game. I want the damage function to fire when a bullet touches plane2, that is the green plane. Can somone please tell me what am I doing wrong here? Here is my code: Here is the link to the game if needed https://shoot.abaanshanid.repl.co/ Answer This …

How to add a Div on a Phaser Game

I have a game.js where all the sprites from my Phaser game is rendered. I also have a index.html that calls this script to render the game. I would like to add a <div> for a health bar over the game.js canvas but I am not able to do it, when I try, it only shows above or below the