Questions tagged [phaser]

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

Filter by
Sorted by
Tagged with
34
votes
1answer
13k views

Difference between Arcade, P2 and Ninja physics in Phaser

I am a beginner and trying to learn game development using Phaser. Currently Phaser is providing three physics systems namely Arcade, P2 and Ninja. But I don't know the differences between them and I ...
2
votes
1answer
165 views

Can I generate character with several layers?

Newbie question: I wonder if it is possible in terms of performance to generate characters in several layers in phaser (and in general). And overall if it is a good idea/practice in terms of pro/cons. ...
6
votes
3answers
15k views

How to place a sprite in the center of the world in Phaser

I am very new to Phaser. Here is what I did: ...
3
votes
1answer
776 views

How to use 16/32 square pixel tiles in tilemap on arbitrarily sized canvas in Phaser

My question is about Phaser and Tiled but I'm not quite sure how to ask it so please bear with me. Do I need to make the size of the canvas or area on which I want to display my tilemap a multiple ...
2
votes
1answer
2k views

How to post player´s score on Facebook (with js)

I have my game made with Phaser (and compiled with cocoon.io) and on the leadersboard state I want to let the user to post his score on Facebook. Well, I created an App on Facebook and I´m not ...
4
votes
1answer
1k views

Change running tween speed

I have words inside a tween and I need to slow down a tween that is already running and I am using updateTweenData to do so. All running tweens are in an array. updateTweenData works, but the ...
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 ...
0
votes
1answer
554 views

Custom arcade physics rate (e.g. bullet time)?

Is there a way to modify the rate that physics is applied, either globally or on a per-sprite basis in Phaser? That is, how can I slow down or speed up the rate at which sprites move around, or fall ...
6
votes
4answers
2k views

Rotating sprite around another sprite

I am building a pool game, and I want to make the cue rotate around the white ball. Here is the live code: http://199.26.84.223/nocol.html Here is the code for the white ball: ...
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 "...
3
votes
1answer
149 views

Collision happens even though the objects are not colliding according to what we see

I'm trying to build a pool game as my first phaser project. The biggest challenge today was to make the cue rotate around the white ball. After hours of searching and not finding anything useful (...
5
votes
1answer
3k views

Switching from Arcade to P2 physics in Phaser

so i just started using phaser for test i've followed the tutorial in the phaser website (making-your-first-phaser-game) everything is clear no problem . but since i've making a pool game i need ...
0
votes
1answer
139 views

TypeError: R[o5R.F6s] is not a function in changing states in phaser box2d

i build my game using phaser.2.4.3.min.js and phaser.2.2.2.box2d.min.js When trying to change states this error is being raised <...
4
votes
2answers
7k views

How can I apply a glow filter in Phaser?

I'm trying to get the following effect, but as far as I know, a filter is the only sensible way. Imagine some objects and background, and a fire ball passing through. The fireball glows. All objects (...
3
votes
1answer
2k views

TypeError: this.scale.setScreenSize is not a function

Game work with the old version 2.0.6. But they get this error after switching to 2.4.2 TypeError: this.scale.setScreenSize is not a function any Idea how to ...
0
votes
1answer
256 views

What is the best way to manage 'state' in Phaser?

I have heard that this is not the best way to manage state in phaser ...
3
votes
1answer
6k views

How do I add a sprite to an object layer?

I am using Tiled to create a map which I am then using for a game written in Phaser. I cannot figure out how to add a Sprite into the Object layer using the Tiled editor. I am having to do it with ...
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
2answers
1k views

which state to add main menu for simple browser game with phaser

In which state should I add the main menu, or should i make it into another separate state? My main confusion here is how I manipulate states properly. Im a phaser/gamedev noob and I dont know how to ...
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.(...
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? ...
1
vote
1answer
640 views

how to make coins explode out of monster in phaser?

I am trying to make coins explode out of a monster when it is killed. the explode would be similar to this example: http://phaser.io/examples/v2/particles/diamond-burst I also want the coins to be ...
0
votes
1answer
343 views

Discrete movements in Phaser

What is the best approach to let a Phaser.Sprite do discrete movements? It should continue moving along all possible values, but at the end of a move it must end up on a certain position which will ...
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 ...
0
votes
1answer
695 views

Use spritesheet frames as particles?

I want to use frames from a spritesheet as particles for my emitter. I load my spritesheet with : ...
1
vote
0answers
562 views

In Phaser, how should I be managing state? [closed]

I'm quite new to Phaser and JavaScript really confused about state management. Phaser has lots of documentation and info on the net, but everyone seems to be doing it a different way. An example: <...
2
votes
1answer
3k views

How do I add my phaser.js game to my pre-made web page?

First off, it's my first time doing a little bit of game development, and I have no idea of the normal flow of making a game, let alone a browser game. My game uses the phaser framework of HTML and ...
0
votes
1answer
831 views

No sound in android using Phaser [closed]

I have developed a simple game using Phaser. It's work perfect on ios webkit, but on android there is no sound. What causes this problem on one platform but not the other? We are using this code to ...
1
vote
1answer
536 views

web based networked game physics efficiency

I am writing a web based game, using websockets. its pretty simple, two players shooting at each other with bullets that have acceleration from a starting point at an angle. The client side (...
11
votes
2answers
16k views

Displaying a particular sprite from spritesheet using Phaser

I am trying to make a card game using Phaser, the HTML5 JS framework. Because I'm a terrible artist and can't design my own, I'm using a free spritesheet of playing card images I found online. The ...
0
votes
1answer
2k views

Text width phaser.js

Does phaser have any function that returns the width of the text or if not, how can I center text inside rectangle I've drawn? Thanks!
3
votes
1answer
4k views

How to handle the different frame rate on different devices?

I am not quite sure how frame per second works on a web page. I have a Canvas game that involves in moving an image from point A to B, and measuring the time elapsed. The code can be as simple as: <...
0
votes
1answer
926 views

How to color each letter text in Phaser.js?

I have a text created with text object (game.add.text) and I would like to color each letter differently if that is possible. If not, how can I achieve this?
1
vote
1answer
434 views

How can I implement smooth digging effects in a tile-based game?

I'm trying to make a Dig Dug styled game where you will be digging into a material. This is going to be a tile-based HTML5 game and I have decided to use the Phaser framework. One way to do the ...
1
vote
1answer
198 views

Phaser/HTML5 - Trying to add five instances to a group and display on the screen!

just started using Phaser today after seeing Thomas Palef's lessmilk series. I completed PhotonStorm's "Make your first Phaser game" tutorial, and grabbed the skeleton, some CSS, and started to throw ...
6
votes
1answer
3k views

How can I run a Phaser engine game without a window?

I'm currently creating a multiplayer game using the HTML5 framework Phaser. It's a game where zombies spawn on the map and players have to shoot them to kill them. The zombies target players that are ...
3
votes
1answer
3k views

(Phaser) Preload Future States in Create?

I'm a first time user of Phaser, been trying to make a simple point and click type game. I'm trying to keep things very modular, so I'm defining a list of levels (states) in a JSON, and then every ...
13
votes
4answers
1k views

How to implement soft edge areas with particles

My game is created using Phaser, but the question itself is engine-agnostic. In my game I have several environments, essentially polygonal areas that player characters can move into and be affected ...
5
votes
1answer
3k views

Adapting tilemap algorithm to support isometric tilemap

I'm using Phaser to build an isometric game. The framework doesn't have support for isometric tilemaps yet, so I'm starting to write a PR for it to support. What I currently have, loading an ...
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 2
3