Skip to content
Advertisement

Tag: phaser-framework

Is there a way to check if an object is really released?

Per the doc, destroy() method Destroys this Game Object removing it from the Display List and Update List and severing all ties to parent resources. Also removes itself from the Input Manager and Physics Manager if previously enabled. Use this to remove a Game Object from your game if you don’t ever plan to use it again. As long as

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 can I do this? Answer The solution is found.

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 well. Keep moving

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 risen thousand times a minute… I’m using Phaser 3

Phaser 3: load spritesheet for animation with unequal dimensions

Im trying to work with the phaser 3 framework. In order to load a spritesheet and create its animation I first load the spritesheet: this.load.spritesheet(‘player’, ‘assets/spritesheets/player.png’,{frameWidth:16,frameheight:16}); then I create the animation as follows: This works fine but if I have unequal dimensions such as I receive the following error: if i print console.log(this.anims.generateFrameNumbers(“player”)); the output is: however for the unequal

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 works: but

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

Advertisement