Questions tagged [phaser]

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

44 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
189 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 ...
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....
3
votes
0answers
217 views

Find all tiles by ID in layer

In phaser 2.6.2, is there a way to retrieve all tiles given their ID from a TilemapLayer? The method searchTileIndex on Tilemap ...
3
votes
1answer
593 views

Can't make sprite collide with tilemap made with Tiled

I'm a newbie who just started learning phaser. I have created a tile map with Tiled. It is composed of two tiled layer: background & collision. In collision layer I put some walls. And in the ...
3
votes
0answers
285 views

Rendering the whole game world

I'm trying to create a live minimap of the complete game world. In order to do that I'm taking a snapshot of the whole game world (not only the part that is displayed) every 100ms or so. The code I'...
2
votes
0answers
150 views

Phaser: Shader Chain

I want to implement lighting via shadowmaps. I see process as: 1) render something to RenderTexture1(size as game) 2) create RenderTexture2 (custom size) 3) add it to Image2 (custom size) 4) apply "...
2
votes
0answers
889 views

Tilemap layer scaling and Camera issue in Phaser

I'm working with the Phaser framework and I'm struggling with a camera/rendering issue when scaling a tilemap layer to simulate a zoom feature in my project. The camera size is set to 1024x768px.(...
1
vote
1answer
254 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
2answers
522 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
472 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 ...
1
vote
0answers
332 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. ...
1
vote
0answers
175 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
203 views

Multiplayer client-side physics

I'm trying to handle all the physics on the client and correct data on the server. e.g. ...
1
vote
1answer
610 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 ...
1
vote
0answers
175 views

PIXI v4 - Is possible to disable Multi Texture Batching in PIXI v4 ?

I would like to know if is possible to disable the multi texture batching in a PIXI V4 game. Recently i jus update my game PIXI lib from version 3 to 4.2. I`m using cocoon Canvas + . It seems ...
1
vote
0answers
767 views

How to use multiple tilesets in a map?

I'm currently looking at this phaser example: http://phaser.io/examples/v2/tilemaps/blank-tilemap Here, the author creates a simple tilemap editor. In line #33 he adds a preloaded image as tileset. ...
1
vote
0answers
55 views

Sprite not being destroyed after being walked on (Phaser 2.4.6)

I've been developing a game for not long in the Phaser framework so I may be a little nooby so be warned. I have a timer that runs whenever an update is called and it would set the sprite I walked on ...
1
vote
0answers
464 views

Using canvas graphics instead of traditional sprites in phaser

I'm trying to learn Phaser (total beginner with mild JS experience) and I'm following tutorials and such where everything is using sprites. I'm trying to get by with basic canvas shapes instead of ...
1
vote
0answers
169 views

can i modify canvas outside Phaser's update or create functions?

can i create/change/destroy game objects (i.e. sprite, text) outside "create" function or "update" game-loop? i'm working on a multiplayer game with nodejs and socket.io, and following is my former ...
1
vote
0answers
273 views

Donut-shaped / inverse mask in Phaser

I am trying to get a donut-shaped mask in Phaser (essentially the inverse of a regular mask). The mask shape is dynamic so it needs to be a Phaser.Graphics polygon object. Desired result: The blue ...
1
vote
1answer
550 views

Resizing a tiledmap when using phaser

...
1
vote
0answers
407 views

How do I combine multiple squares into one Tetris block?

I am learning Phaser by making a simple game—Tetris. I'm having difficulties: Can I use simple rectangles as tetrominoes or they should be sprites? I don't know how make the figure's block from ...
1
vote
2answers
390 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
0answers
19 views

Phaser 3 - Show items from object layer - image not loading

Trying to create a collectible objects from object layer I've created with Tiled, however, don't know the proper way to map the objects and my image file which contains several images. What would be ...
0
votes
1answer
27 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 ...
0
votes
0answers
28 views

Resizing the camera view in Phaser 3 just like in Unity

I started to work in Phaser 3 with a previous background in programming in Unity and I can't figure out how to zoom the camera view. In Unity, I can change this value, to resize the camera view: Then,...
0
votes
1answer
65 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 ...
0
votes
0answers
18 views

On/off buttons in Phaser

I am trying to make an on/off button for audio in Phaser, and when you click on the button once it shows the off button, but when I click on it again, the on button does not show. Right now I did not ...
0
votes
0answers
19 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 ...
0
votes
0answers
86 views

Phaser 3 - How to make 2 object merging after collision (Like Claw Machine)

I'm new in Phaser 3. I use Matter.js for physics. I want to create something like Claw Machine : I have a claw (top) and prize (bottom) The claw will take a prize from bottom When claw hit the prize, ...
0
votes
0answers
182 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 ...
0
votes
0answers
29 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 ...
0
votes
1answer
129 views

Any way 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 group a drag event. Can ...
0
votes
0answers
46 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 ...
0
votes
1answer
105 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
0answers
271 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 ...
0
votes
0answers
25 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
619 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
1answer
603 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
3k 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 ...
0
votes
0answers
370 views

how to pick up multiple coins with Phaser?

I have a function that drops coins but I can only pick them up one by one when I click on them. Is it possible to make it so that I can pick up anything that overlaps? ...
0
votes
0answers
132 views

Fix latency when sending state

I have a multiplayer game done with Phaser, which runs in the browser and on a node.js server. The server is authoritative, every 50ms or so it sends the game state object to all clients. The clients ...
0
votes
0answers
1k views

making Circle button in phaser

im trying to make a circle button with tap event i used hitArea property from sprite class and using pixi Circle class i did that ...
-1
votes
1answer
1k views

How to use custom font in Phaser?

I am trying to load WebFont in Phaser. I have seen the Phaser example, but I can't understand what asset do I need, what function I have to call, & what ...