Questions tagged [phaser]
Phaser is a JavaScript framework for game development on desktop and mobile platforms.
36
questions with no upvoted or accepted answers
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 ...
3
votes
0
answers
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
0
answers
233
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
1
answer
628
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
0
answers
293
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
0
answers
166
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
0
answers
926
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
1
answer
305
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
0
answers
375
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
0
answers
178
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
0
answers
211
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
1
answer
690
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
0
answers
183
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
0
answers
797
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
0
answers
56
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
0
answers
470
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
0
answers
177
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
0
answers
294
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
1
answer
567
views
1
vote
0
answers
412
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 ...
0
votes
0
answers
44
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:
...
0
votes
1
answer
147
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
0
answers
42
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
0
answers
421
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
0
answers
48
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
0
answers
69
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
1
answer
148
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
0
answers
329
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
0
answers
28
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
0
answers
691
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
1
answer
717
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
1
answer
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
0
answers
384
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
0
answers
141
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
0
answers
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
1
answer
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 ...