Questions tagged [phaser]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
445 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 ...
2
votes
1answer
637 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
1answer
709 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 ...
1
vote
0answers
199 views

Multiplayer client-side physics

I'm trying to handle all the physics on the client and correct data on the server. e.g. ...
2
votes
1answer
716 views

Infinite scroll with tweens in Phaser

Let's say you have a bunch of tweens running like this: http://holbrook.no/tests/featherfall.html Now you want to scroll them horizontally while they fall. By updating camera x, they start moving, ...
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....
1
vote
0answers
171 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
1answer
2k views

Planet gravity? [duplicate]

I am trying to make a game with the Phaser game engine and would like to implement some sort of planetary gravity. Essentially I just want the player to be able to walk on a circle or orbit a point. I ...
2
votes
1answer
583 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 ...
-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 ...
0
votes
1answer
61 views
-2
votes
1answer
154 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 ...
2
votes
1answer
252 views

How do I add a PIXI container into a Phaser Game?

How do I add a PIXI container into a Phaser Game? I have a game made ONLY with PIXI. but now i would like to port it to a Phaser. All my game content happens inside a pixi container "...
3
votes
2answers
367 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
62 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
357 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
172 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 ...
3
votes
1answer
2k views

Intellisense with PhaserJS Library in Visual Studio Code

I am trying to use Visual Studio code along with PhaserJS but am confused about why the isn't working. I've read through http://www.johnpapa.net/intellisense-witha-visual-studio-code/ am think I ...
1
vote
1answer
1k 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 ...
3
votes
0answers
214 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 ...
5
votes
2answers
2k views

Animations with individual images in Phaser.js

So I have this game that I made a while back and I want to port it using Phaser. The game is made using individual PNG files for all the animation frames, and there are over 100 of them. From ...
1
vote
2answers
403 views

Sync bullets node.js phaser.io

i am currently having a struggle thinking about syncing bullets. I am using node js and phaser.io and I am creating top-down shooter. I would do it like this: Player shoots a bullet. Player sends ...
3
votes
1answer
807 views

Is it possible to make a pseudo isometric game with phaser?

If I use the isometric plugin for Phaser, I end up with something like the third case of the following picture: I would like to create a world in pseudo isometric, with only one axis tilted. This ...
2
votes
1answer
146 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 ...
0
votes
1answer
811 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 ...
0
votes
1answer
362 views

Trouble loading sprite from spritesheet with Phaser

I am working on re-creating a breakout clone to help me learn Phaser (following the overall design of jsbreakouts.org). Anyway, I have the start screen set up. From the start screen, I can transition ...
1
vote
2answers
140 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 ...
0
votes
2answers
2k views

How to kill a fired bullet sprite after certain amount of time in Phaser?

The bullet should be killed after it was shot from the player, and after a certain amount of time. ...
1
vote
2answers
611 views

Phaser BitmapData Pick Color and Paint

Hi guys, Could anyone kindly shows me a little bit of code about pick and paint color to the sprite? here is my code that I have played around, but I still cannot find out and achieve it. Thanks ...
2
votes
1answer
2k views

Does Phaser Arcade.Body velocity include deltaTime or not?

I want to move my character along the x axis with constantly speed. I thought move depends on frame rate. So, technically I should write ...
0
votes
1answer
2k views

add physics to a group or container body in phaser

I'm developing a HTML5 Phaser game. In this game I do have a Group which I would like to behavior as a physics body (arcade-physics). It is a character with a lot of moving parts (sprites) inside ...
1
vote
1answer
160 views

In PhaserJS, how do I get a clicked Physics.P2 body's data?

I have a sprite with Phaser.Physics.P2 enabled, using a custom shape loaded with loadPolygon() from a ...
0
votes
1answer
3k views

Phaser.io with Socket.io - What should the Server calculate and what the Client?

I'm currently playing around with phasio.io and socket.io to create a really simple multiplayer. For the beginning i created basic movement which is synched via socket.io. The clients are sending ...
3
votes
0answers
284 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
1answer
117 views

Point plotting with a line graph

Please see attached screenshot. Here's how it works. A is a slider that goes up and down, and the red line uses the centre point of the A slider to draw its start point. B is another slider, but ...
1
vote
0answers
750 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. ...
3
votes
1answer
3k views

Phaser / PIXI: World size vs. Stage size

I am using Phaser to build a zoomable / pannable 2D map with the intended functionality being that the home camera position is always in the middle of the World coordinates. I have a problem where my ...
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
463 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 ...
2
votes
3answers
2k views

How to center a tilemap in Phaser?

In Phaser, I am loading a Tilemap from JSON. I would like my Tilemap to display in a particular position (for simplicity here I say the middle of the screen). ...
4
votes
1answer
831 views

“Industry Standard” JSON formats for game assets [closed]

This question is inspired by my venture into the Phaser game engine but seems to apply to any engine that uses JSON for its asset format. Phaser relies on PhysicsEditor to export and create the JSON ...
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
160 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
689 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
162 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
552 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: ...