Questions tagged [phaser]
Phaser is a JavaScript framework for game development on desktop and mobile platforms.
148 questions
1 vote
2 answers
164 views
How to make health bar or speech follow but not rotate with character container?
I have a top-down character object that is a Container of various parts. This character can have elements that should move along with it (think a health bar, a speech bubble) that should NOT rotate ...
1 vote
2 answers
218 views
How do you avoid duplicating code when implementing a multiplayer game using client authoritative server architecture?
I am building a real time a multiplayer web game using client authoritative server architecture, phaser, node, aws, etc. For an example, if I have a player that walks right and picks up food, I need ...
0 votes
1 answer
74 views
Object created in function triggered by emitter does not run constructor
I'm working on expanding on the tutorial found here I currently am creating two classes based off of menu ...
1 vote
1 answer
195 views
How to fill the rest of the viewport with a Phaser game's content?
In Phaser, is it possible to fill the remaining part of the Browser window with the game's (clipped) content, and still keep the aspect ratio of the game intact? For example, I have a game which is ...
1 vote
1 answer
451 views
How to make object movable only by the player?
I'm trying to let the player of my PhaserJS game (with MatterJS physics) move a (static?) object around. That is: the player is allowed to move the object, but otherwise it should be ...
1 vote
1 answer
760 views
Algorithm for taking the shortest path between two XY coordinates
I am making a simple game in Phaser (but the library doesn't really matter). I have an enemy that is moving towards the player on a 2 dimensional grid. I have written some code that makes the enemy ...
0 votes
2 answers
1k views
Scope of 'this' - Cannot read property of undefined in collider and overlap function
I am working on my first 2D game with Phaser 3. I have set up VS Code with a node.js https server and run it to deploy the game on localhost. While the game gets compiled successfully and deployed, I ...
0 votes
1 answer
183 views
Predict future position of a moving body in Phaser arcade physics
I am looking for an equation for predicting the future position of a moving arcade physics body in Phaser 3. The body has drag applied and isDamping set to true. Phaser applies the drag using the ...