Questions tagged [phaser]

Phaser is a JavaScript framework for game development on desktop and mobile platforms.

Filter by
Sorted by
Tagged with
0
votes
0answers
15 views

Phaser + WebSocket server side running very slow, need help optimizing

We're making a web-based game using Phaser and SocketIO for real-time player interaction and synchronization of in-game objects (such as items and enemies with synchronized dynamic movement). Here's ...
0
votes
0answers
14 views

How do I scale a group in Phaser 3

In Phaser 2 we scale a simple by setting the scale property as explained in docs: https://phaser.io/examples/v2/groups/group-scale But there is no equivalent in Phaser v3. The possible url https:...
1
vote
2answers
101 views

How to create a map array with multiple layers?

I’m trying to create a map array without using JSON because I want to dynamically generate the map: ...
0
votes
1answer
37 views

Phaser 3 physics bug in platformer game

I'm writing a platformer lode-runner-like game. I would like to ask experienced people to see what's wrong. Everything seems to be ok but I am absolutely confused about 3 bugs. Why is the player ...
0
votes
1answer
53 views

Why is my player still moving down when I set its gravity to 0?

I'm writing Lode Runner like platformer game. I'm trying to solve player sprite slowly moving down when on ladder by setting player.body.gravity.y = 0. I have ...
0
votes
0answers
42 views

Client side prediction in 2D rigid-body physics

I'm currently working on 2D rigid-body physics multiplayer game using Matter.js for physics (both the client and server side) and Phaser3 for rendering. Both the server and the client run the ...
1
vote
1answer
58 views

Behaviour of containers in Phaser 3 framework

I don't understand the behaviour of containers in this example: Phaser example The part I don't unerstand is line 41. Why is lastContainer assigned to newContainer? In line 40, newContainer is added ...
1
vote
1answer
198 views

How to detect collision direction in Phaser 3

Please consider this scene. Developed using PhaserJS 3. I want to make the slider move left when the player touches the right hand side of it, and move right when the player touches the left hand ...
0
votes
2answers
48 views

Phaser Editor / Phaser 2 Resize State

I’m working with Phaser Editor, and I was wondering if it was possible to resize the scene with the editor or just plain Phaser 2. I want to resize the world, by which I mean to make a camera follow ...
-1
votes
1answer
78 views

Web based poker on Phaser 3

Please can somebody help me as I'm a lil bit new to game dev and user interface designing. I am trying to create a simple Texas holdem poker using phaser3 for multiplayer application. I have a few ...
0
votes
0answers
35 views

Can I load a background image with TileMap.images (Image Layer from Tiled)?

I'm new to Phaser 3. The documentation seems slightly scattered across the web so I'm hoping someone can finally clear up my confusion. Is it possible to load a background image from ...
0
votes
0answers
102 views

Multiplayer physics out of sync

So I'm working on this multiplayer platformer game using Phaser, Matter.js, and Colyseus.js. I have a simple map and player controls set up and now I'm trying to copy my physics simulation on the ...
0
votes
0answers
112 views

How to reduce the velocity in Phaser 3 Matter.js

How to reduce the movement of "coins"? There are matter in Phaser3. coin = this.matter.add.image(12, 11, coinRandom); coin.setCircle(); coin.setFriction(0.005); ...
0
votes
0answers
23 views

How to make physics of motion on an inclined surface

There is the following platform: And a coin above it: And the following code using arcade physics: ...
0
votes
0answers
274 views

Phaser 3: How to assign sprite to proper position

I have been building a game in Phaser 3. When I create a sprite using the Matter physics engine at a specific position, the sprite does not appear at the specified position. Depending on the ...
4
votes
0answers
163 views

Phaser: InvalidStateError

I am using the Phaser framework for game development, but while working on it I face a bug which is annoying, I have the following message: InvalidStateError: An attempt was made to use an object ...
0
votes
1answer
127 views

Phaser: How to call a function inside another function?

So I actually have the following code that works: ...
0
votes
0answers
17 views

Phaser: How to use a simple timer from 0 to 3

I am using the following code (which is a simplified snippet in order to make it more readable): ...
0
votes
0answers
94 views

Problem with the collision system

So,I did the very basic tutorial for phaser 3, which is a platformer. Following along those lines, I made my own custom platform(Striped Wavy Platform) and a custom player sprite(Red Amoeba) but ...
-1
votes
1answer
109 views

Whay can my player only move in one direction?

I am trying out the Phaser 3 framework and I dont know why my player Object moves only left but not right... Here's another weird thing: if I swap code segmentd for move right and move left, then I ...
0
votes
0answers
418 views

Collision detection not working in Phaser 3

I am new to phaser. So I started working on a game but I am stuck at implementing collision detection. I want to do it between a static group(dot) and a Sprite(obs). function create(){ ...
0
votes
0answers
36 views

Phaser js capturing collision.

I need to capture the collision of a sword hitting a group I am new to phaser, I have added an animation with a 'j' key to swing sword , but I need to catch the collision with the 'tree' group when I ...
0
votes
1answer
98 views

Why are not the images loaded in Phaser?

I am starting to use phaser to create games and I found a problem that I can not find for more tests that I did. I can not show the images I am uploading. You only see a small square in the center, (I ...
0
votes
1answer
262 views

Parallax background in with depth in Phaser 3

I'm working on a 2D space shooter type of game in typescript using Phaser 3 and am trying to get a parallax background with different depths going. But I'm having trouble getting the math right. You ...
0
votes
1answer
57 views

PhaserJS: Detecting intersection

I'm making a card game to get my legs with phaser. I have an row of overlapping, face down cards. I want to detect when any card is covered by another card. The deck is shuffled before being placed ...
0
votes
1answer
38 views

Setting a jump counter in my 2d platformer built with phaser

I have a platforming game, written in javascript with the Phaser.js framework, where my character collects objects. I thought trying to collect all objects in the least amount of jumps would be ...
0
votes
2answers
130 views

Why is my spritesheet displaying all messed up in game?

I'm having an issue I don't quite understand, where my spritesheet is looping strangely and not showing the full sprite I want, even though I feel like I'm specifying it correctly. My code is in ...
0
votes
1answer
91 views

Detect mouse over a line in Phaser

We're developing a game in Phaser as a university project and have come across an obstacle. We need to detect when the mouse is over a line between two points. There are not a lot of lines, definitely ...
2
votes
1answer
427 views

One pixel lines flash on tile map when camera moves

I'm writing a simple game using Phaser 3.5.1. I made a 20X20 over world tile map for my hero to walk around on with the camera following the hero. I was able to implement tile based movement using ...
1
vote
0answers
32 views

What are the key considerations I should have when choosing between Phaser 2 and 3? [closed]

I'm planning on experimenting with basic HTML5 game development. Since I'm just learning the ropes I'm sure either engine could support my needs. At the same time I would prefer to focus on the engine/...
0
votes
1answer
862 views

How to change color of text in canvas in phaser.js?

I want to change the text color in my game that is build in phaser.js. But i have no idea how to do this, because i am not a coder. Can somebody help me to change the color of my game text? My Game ...
1
vote
2answers
422 views

Detecting overlap with Phaser P2 physics

In a 2D platformer, I'd like to implement a ladder. I have collision working between the player and ground tiles. Now I would like to be able to detect when the player walks through a ladder tile (...
1
vote
1answer
180 views

How to zoom in and out the full tilemap from center in phaser?

I am developing a game where I need to zoom in entire map also I can be able zoom out. I have created a tilemap using tiled software and rendered it using phaser.js. How can I add this function to my ...
0
votes
2answers
911 views

How player(sprite) in the phaser will opposite or reverse while going left and right?

I am developing a game where my player has to look to see forward when I am pressing right arrow key. But how can I make it look reverse after pressing left arrow? I can create a sprite of reverse ...
0
votes
2answers
397 views

Phaser is not loading the same map created in Tiled software

I have created a sample map using the tiled software. Then tried to load the same on a webpage using phaser.js. But I am not getting the proper result. Is there any mistake in my code or something ...
4
votes
1answer
736 views

How can I generate vertex data from an SVG?

I am trying out the Phaser game engine, and am interested in making a vector graphics game (simple black and white like Asteroids), but I want to use vector graphics instead of raster PNGs. I was ...
0
votes
1answer
999 views

phaser.io mouse cursor sprite

I am trying to build a game and i want people to be able to select stuff with a pointer but i don't want it to be just an ugly looking default pointer so i wrote this code to try and get a image as it ...
-1
votes
1answer
53 views

Phaser problem with .damage oneshots

I am trying to damage player or enemy when they collide.(enemy will be damaged when collided with bullet and player will be damaged when collided with monster) ...
1
vote
0answers
268 views

Phaser Pulling Data from Firebase and Loading it as a sprite

I am trying to pull img data from database to replace it with player sprite url. ...
0
votes
1answer
362 views

Rotating a group of bodies in Phaser

I want to create a game where enemies spawn, fly toward the player's ship, and stick to the side of it. The player can then rotate the ship and the stuck enemies will rotate with it. The way I have ...
1
vote
1answer
584 views

Phaser Always Fix Camera Position to Sprite

I am developing a cross-platform overhead game using Phaser. Is there a way to always fix the position of a camera to a sprite? The following function works great, but I want the camera to always be ...
0
votes
1answer
2k views

Take an image and cut it up into a tile map

So I am attemping to make a game in Phaser. I am trying to think of the best way to cut this image up and make it in to a tile map OR do I try and lay this entire image as a back ground to the game ...
0
votes
1answer
2k views

How to align text dynamically inside a rectangle with Phaser JS

I am just starting to learn the Phaser JS framework with my first game. I did not managed to find a way how i can align text inside a rectangle element dynamically without specific coordinates. Here ...
3
votes
0answers
2k views

Phaser: Scaling to fill screen, maintain pixel ratio, but not aspect ratio

I've used libraries in other languages before that provide different types of scaling via viewport types. The best example of what I want is from a library called libgdx for Java, their ScreenViewport....
2
votes
1answer
582 views

Component based architecture in TypeScript

I'm doing a game using Phaser with TypeScript. I want to implement a component based architecture for Actors. What I'm trying to achieve is this: ...
1
vote
0answers
164 views

Create styled grid with phaserJS gaming framework

I am new to Phaser and this is my first game with Phaser gaming framework. Am trying to find the right way of coding a grid what you see in below image In some articles is being suggested to code it ...
1
vote
0answers
182 views

Multiplayer client-side physics

I'm trying to handle all the physics on the client and correct data on the server. e.g. ...
2
votes
1answer
488 views

Collision not working in phaser node multiplayer

I'm writing a tank trouble clone just for fun using phaser and node, so this is my tank instantiation ...
0
votes
1answer
60 views
1
vote
1answer
384 views

Phaser Tiled map importing

How can I be sure that the tileset used in making a Tiled map remains as a multiple of 2, since this is a requirement of phaser when loading JSON tiled maps? I have tileset images which I got for free ...