Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Make your voice heard. Take the 2019 Developer Survey now

Questions tagged [phaser]

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

0
votes
0answers
23 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
8 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
26 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
32 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 ...
-1
votes
0answers
60 views

How do I load tile map with phaser 3

I created a simple tilemap with tiled, and I'm trying to load it. The code and files can be seen here: https://codesandbox.io/s/qqq47wqv3w I'm not getting any errors in the console, but the canvas ...
-1
votes
0answers
31 views

How can I reference my dialogue box object in my animation?

I hope you can help me with my conundrum. I've stripped the code to hopefully make it easier to read. I'm trying to set up a simple dialogue box. It does work and I can render it and I can destroy it ...
0
votes
1answer
27 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
26 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
79 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
0answers
23 views

How to create an arc physic body in Phaser?

I am trying to make a 60 degree wave attack from center, and the wave will spread from center to the screen edge, something like EMP. But not whole circle, just a sector. If using Phaser framework, ...
0
votes
1answer
72 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
183 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 ...
0
votes
0answers
64 views

Why does my Phaser/Cordova app only work when it is 363 pixels or wider?

I'm running into a very strange issue in an HTML5 mobile game I'm developing using Phaser and Cordova. When I create a new Phaser.Game with a width of 363 pixels ...
0
votes
0answers
728 views

Cannot read property add of undefined Phaser.js

There is a problem with game.state.add() function.For some reason game is undefined Uncaught TypeError: Cannot read property 'add' of undefined at Object.init (main.js:51) at main.js:58 <...
1
vote
0answers
29 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
523 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
293 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 (...
0
votes
0answers
21 views

How to show full tilemap using phaser?

I have created tilemap using Tiled software of pixel size 1200x1000. While rendering it using phaser I have set width equal to 500 and height equal to 400.After this only map of 500x400 area is ...
1
vote
1answer
57 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
419 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
0answers
90 views

How to fill color in tile using phaser?

I want to fill the color in specific tile. The method available in phaser is putTile(), But I want to fill any color I want. In canvas there is method called fillrect(). Please suggest me some ...
0
votes
2answers
191 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 ...
0
votes
0answers
71 views

Draw collide-able boundaries using polyline

Pretty straightforward question: I want to draw my collision layers in Tiled, preferrably using the Polyline tool. Using Phaser: 2.6.2 Physics: Arcade I would use ...
3
votes
1answer
325 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
763 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
43 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
199 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
269 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
430 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
819 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
1k 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
1k 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
449 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
149 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
154 views

Multiplayer client-side physics

I'm trying to handle all the physics on the client and correct data on the server. e.g. ...
3
votes
1answer
355 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
56 views
1
vote
1answer
226 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
1answer
271 views

How to transfer drag control from one sprite to another? (Phaser)

I have some sprites that are set to horizontal drag only. What I want to do is, if someone drags vertically up from one of those sprites, when they leave the bounds of that sprite (top edge), spawn a ...
-4
votes
1answer
137 views

Phaser Shooting Game [closed]

I am making an shooting game in Phaser. I want to control the gun using the arrow keys i.e.: upArrow, DownArrow and Enter upArrow : is to increase the angle downArrow : is to decrease the angle Enter ...
4
votes
2answers
296 views

Pathfinding in Isometric Phaser with Tunnels

I want to create a 2D isometric game. Currently I'm looking and testing Phaser game engine with isometric plugin. Almost everything at the moment looks possible except few things. I will create a ...
0
votes
1answer
57 views

Phaser game is not registering collisions and input - but only on my machine [closed]

I was developing a game with Phaser and the Zenva Phaser Tutorial. I did some work on it last night, checked it was working, and went to bed. This morning, it isn't working! Input (either touch or ...
1
vote
0answers
275 views

Creating 2D worldbuilding games like Terraria or Starbound in frameworks like PhaserJS or PixiJS? [closed]

Frameworks like Phaser or Pixi support tilemaps, but I'm curious if that is already enough to get a map where the player can change everything that he wishes. I'm also not sure if browsers would be ...
1
vote
0answers
149 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
1answer
838 views

How do you do tile-based movement in Phaser?

I'm looking to make 2D game that is very similar in movement to Pokemon Red or Blue (player must move a full tile in any direction, the ground moves smoothly beneath the player as they walk). I've got ...
2
votes
0answers
175 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 ...
1
vote
2answers
2k views

Why can't i change the background color in Phaser?

what is wrong with my code? i'm using game.stage.backgroundColor but the screen remains black. main.js: ...
0
votes
1answer
542 views

Phaser: show text when overlap sprites

I am trying to work out a way to add a text to the top left corner of the viewport when two of my sprites overlap. One of them is a item and the other is my character. I can already detect for overlap ...
2
votes
1answer
97 views

setSize in Phaser.io

so I've been troubleshooting for hours now. I am using the latest version of Phaser.io and I cannot get troubleshoot the errors. I am aware that it is related to ...
1
vote
2answers
130 views

Loading maps on HTML5 Games

I was wondering if my 2D Pixel Art platformer HTML5 game(a lot of words there..) should have loading screens for maps. My game has different maps and I don't know if a loading screen should be ...