Questions tagged [phaser]

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

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

addTilesetImage to map built with images collection

I’ve built a map with Tiled with a tileset built from an images collection. So, I would to know how to load this tileset in my Phaser 3 scene? Here where I am in my code work: ...
user avatar
0 votes
1 answer
87 views

Tween a pop-up containing several buttons

I am developing a small game with Phaser 3. I want to make a container with several buttons, representing a pop-up dialog. The container needs to pop up on completing a task. When container pops up, I ...
user avatar
  • 11
0 votes
2 answers
630 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 ...
user avatar
  • 11
-2 votes
2 answers
60 views

Phaser 3 animation API

I am following the tutorial for Phaser 3 game development and came across the following line of code. player.anims.play('Left', true); I am curious about the ...
user avatar
  • 11
0 votes
1 answer
58 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 ...
user avatar
  • 11
0 votes
1 answer
60 views

How to justify text that appears character-by-character

I'm currently using the latest version of phaser framework and I have a problem to which I haven't been able to figure out how to approach. I need to have a block of text appear letter by letter and ...
user avatar
0 votes
1 answer
136 views

Isometric tilemap circle around object

I am developing an isometric game like Anno 1602. I have an isometric tilemap. The default tilesize is 64x31. My goal is to show the area a building has influence to. For that I want to show a circle ...
user avatar
  • 101
0 votes
0 answers
33 views

Phaser Game not rendering on normal page

I made a game with the Phaser game framework on a course, and now I want to add features and build upon that game. The only problem is that I built the game with the course on webpack, which served ...
user avatar
0 votes
0 answers
408 views

Slot machine game Phaser 3

I need an advice on creating a slot machine phaser game. So it looks like this I need to plan an approach to do the animation of the reels of the slot machine. I have idea of using tileSprite, are ...
user avatar
1 vote
1 answer
75 views

Camera bounds with container overflow

I'm using Phaser to create a small web based game, but I would like some advice on how to handle multiple resolutions and scrolling. Basically what I would like to achieve is the following : The game ...
user avatar
  • 111
2 votes
1 answer
3k views

Phaser 3 - How to trigger an event every 1 second?

I have just started learning Phaser 3 and making a simple idle game, where you would gain x resources per second. What is the best/recommended way to do something like this? The two main ways I have ...
user avatar
  • 780
0 votes
0 answers
45 views

Correct way to control a scene

I'm trying to build an '90s style rpg game, think dragon warrior series, where it will have a UI box at the bottom of the screen where the user makes a choice like attack, move, eat etc I'm thinking ...
user avatar
  • 153
0 votes
2 answers
588 views

Launch event at the end of an animation with phaser 3

I'm starting to develop in Phaser 3, and I'm really a begginer. I'm trying to make an attack move of an archer sprite, but I cannot make it work right... This is how I have defined the things related ...
user avatar
0 votes
1 answer
150 views

Set background color in Phaser

I want to set a background color for my game. I found this solution: function create() { this.cameras.main.setBackgroundColor("#d5d5d5"); } but I want to be ...
user avatar
0 votes
1 answer
265 views

How to set drag events on a Phaser 3 group?

I'm trying to set a drag event on a Phaser 3 group, but I wasn't able to achieve what I want. I was reading some Phaser 2 blogs, and they said that it isn't possible to set a drag event on a group. ...
user avatar
0 votes
1 answer
53 views

setTint() on half image

I'm developing a game where I need to paint half of a image when the user is either wrong or right. To paint the image, I'm using setTint() to paint the image the ...
user avatar
0 votes
0 answers
67 views

Portrait and Landscape Design

I have a turn-based game that is built with HTML 5 gaming framework and runs completely fine in Landscape mode. What I am trying to figure out is how to make the game run fine in both portrait and ...
user avatar
  • 1
1 vote
2 answers
551 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: ...
user avatar
0 votes
1 answer
141 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 ...
user avatar
  • 3
0 votes
1 answer
433 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 ...
user avatar
  • 3
0 votes
0 answers
324 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 ...
user avatar
1 vote
1 answer
297 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 ...
user avatar
  • 11
1 vote
1 answer
2k 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 ...
user avatar
  • 111
0 votes
2 answers
160 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 ...
user avatar
  • 1
0 votes
1 answer
322 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 ...
user avatar
0 votes
0 answers
27 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: ...
user avatar
4 votes
0 answers
204 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 ...
user avatar
  • 143
0 votes
1 answer
361 views

Phaser: How to call a function inside another function?

So I actually have the following code that works: ...
user avatar
  • 143
0 votes
1 answer
173 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 ...
user avatar
0 votes
0 answers
681 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(){ ...
user avatar
0 votes
1 answer
698 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 ...
user avatar
0 votes
1 answer
708 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 ...
user avatar
  • 253
0 votes
1 answer
85 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 ...
user avatar
  • 131
0 votes
1 answer
144 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 ...
user avatar
0 votes
2 answers
299 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 ...
user avatar
0 votes
1 answer
154 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 ...
user avatar
2 votes
2 answers
2k 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 ...
user avatar
  • 161
1 vote
0 answers
35 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/...
user avatar
  • 161
0 votes
1 answer
2k 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 ...
user avatar
1 vote
2 answers
564 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 (...
user avatar
2 votes
1 answer
735 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 ...
user avatar
  • 25
0 votes
2 answers
2k 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 ...
user avatar
  • 25
0 votes
2 answers
846 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 ...
user avatar
  • 25
4 votes
1 answer
2k 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 ...
user avatar
  • 209
0 votes
1 answer
1k 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 ...
user avatar
-1 votes
1 answer
59 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) ...
user avatar
1 vote
0 answers
373 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. ...
user avatar
0 votes
1 answer
532 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 ...
user avatar
1 vote
1 answer
809 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 ...
user avatar
0 votes
1 answer
4k 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 ...
user avatar
  • 153