Questions tagged [phaser-framework]

Phaser is a JavaScript framework for game development on desktop and mobile platforms. This tag can be used for all versions of Phaser.

Phaser is a JavaScript framework for game development on desktop and mobile platforms. If the device is capable, then it uses WebGL for rendering; otherwise, it fallbacks to Canvas. It's just plain JavaScript, and doesn't use any faux OO-style practices internally. There's no massive inheritance chain or component system, and you don't have to force your objects into any fixed class structure, either. It's a simple, straightforward prototype chain, the way JavaScript was meant to be used. Phaser relies 100% on community backing to fund its development.

Version Details as of September 2020:

  • Latest (Community-lead): Phaser CE 2.16.0
  • Latest (Next-generation): Phaser 3.24.1

Note

Phaser is available in two versions: Phaser 3 and Phaser CE - The Community Edition. Phaser CE is a community-lead continuation of the Phaser 2 codebase and is hosted on a separate repo. Phaser 3 is the next generation of Phaser.

Requirements

Games created with Phaser require a modern web browser that supports the canvas tag. This includes Internet Explorer 9+, Firefox, Chrome, Safari and Opera. It also works on mobile web browsers including stock Android 2.x browser and above, and iOS5 Mobile Safari and above. But, as always, be aware of browser limitations. Not all features of Phaser work on all browsers.

Features

  • Supports both TypeScript & JavaScript
  • Uses WebGL & Canvas Technologies
  • Asset Preloader
  • Built-in Physics Engine
  • Sprites Support
  • Animation using Sprite Sheets
  • Built-in Particle Engine
  • User Input Handling
  • In-game Camera
  • Supports HTML5 Sound
  • Optimized for mobile
  • Plugins to extend the core features

Resources

2071 questions
66
votes
2 answers

Decide Pixi.js or Phaser

One of my school project is to make a realtime multiplayers webpage game, I am currently having difficulty to decide if I should go Pixi.js or Phaser for the game graphic and control, could anyone talk a little bit about what they are good at and…
Kuan
  • 11,149
  • 23
  • 93
  • 201
63
votes
2 answers

Only 'amd' and 'system' modules are supported alongside --out

When building typescript in VSCode, I get the following error: error TS6082: Only 'amd' and 'system' modules are supported alongside --out. My settings are as follows: tsconfig.json { "compilerOptions": { "target": "ES5", …
OCDev
  • 2,280
  • 3
  • 26
  • 37
24
votes
1 answer

How can I make an infinite side scrolling background in Phaserjs?

I'm using phaser.js to make a game and I cannot find any tutorials on how to make the background scroll infinitely. I'd like the background to tile/repeat sideways, and infinitely as the character moves right. I am currently using a camera and…
mage
  • 626
  • 2
  • 8
  • 18
22
votes
4 answers

How to make canvas responsive using Phaser 3?

Previously I was working on Phaser 2 but now I need to switch to Phaser 3. I tried to make the canvas responsive with ScaleManager but it is not working. I think some of the methods changed but I didn't find any help to rescale the stage full…
Kothari Ankit
  • 296
  • 1
  • 4
  • 12
22
votes
5 answers

Local server not reflecting updated files

I'm fairly new at user local servers. I'm using the http-server which is a package from Node. I'm using it to host an HTML5 game using the Phaser library. I have image assets I'm using in the game, and I sometimes update these assets. When I do, the…
Jake Moritz
  • 843
  • 2
  • 9
  • 21
21
votes
1 answer

How to add Spine animation to Phaser game?

I am new to Phaser and the whole javascript games, and I am trying to add Spine animation to Phaser. Is there a way to do that? I also tried to play my animation using Pixi.js and it worked. Also I know that Phaser is built on top of Pixi, can…
Mohamed Termoul
  • 369
  • 2
  • 13
19
votes
3 answers

HTML moving phaser into container div

Currently making up a browser based game in phaser and trying to add it into the container div tag I've created however phaser seems to be pushing itself to below the container div. Two screenshots for…
Marc Brooks
  • 369
  • 1
  • 6
  • 15
18
votes
3 answers

Should I use Phaser 3 or Phaser 2/CE?

I am new to game development and I want to learn game dev. I have discovered the Phaser framework and I want to learn it. Should I learn Phaser 3 or Phaser 2/CE? What is the difference?
nazimboudeffa
  • 939
  • 6
  • 20
18
votes
1 answer

2D soft bodies: Gelly and moldable?

I am using Matter.js physics in an attempt to create soft bodies. I was able to create a body like this: However I am not sure if this is the "soft body" I want. It is true that this body is not entirely rigid and has that bouncy feel when it…
Kunis
  • 576
  • 7
  • 24
18
votes
2 answers

Destroying sprites in Phaser

I'm having trouble destroying Sprites in Phaser. I have a JavaScript object, let's call it Block. Block has a sprite property, that gets set like so: this.sprite = this.game.add.sprite(this.x, this.y, 'blocks', this.color); At a certain point in my…
alexania
  • 2,395
  • 2
  • 13
  • 11
16
votes
3 answers

How can I scale the size of a sprite in Phaser/PixiJS without changing its position?

I'm making a game in Phaser using some large images that I want to scale down in the actual game: create() { //Create the sprite group and scale it down to 30% this.pieces = this.add.group(undefined, "pieces", true); this.pieces.scale.x…
Migwell
  • 18,631
  • 21
  • 91
  • 160
15
votes
4 answers

Phaser.io 3: Get game size in scene

It seems to be a simple question, but I just cannot resolve it: I'm using Phaser.io 3 HTML5 game framework with ES6 classes, and I try to figure out the actual "Game Size" (or canvas / viewport size), so that I can center an object on screen: class…
Alex Schenkel
  • 728
  • 1
  • 7
  • 13
15
votes
8 answers

Phaser 3. Change dimensions of the game during runtime

Hi please help me to find out how trully responsive game can be created with Phaser3. Respnsiveness is critical because game (representation layer of Blockly workspace) should be able to be exapanded to larger portion on screen and shrinked back…
bFunc
  • 1,370
  • 1
  • 12
  • 22
14
votes
1 answer

How to create a responsive game for any screen size with Phaser 3?

I've been looking for a solution to be able to make my game fully responsive to any screen resolution using Phaser 3, for example: This example was made with Construct 2, where by the way it is very simple to do this effect. Does anyone know what…
shimo
  • 367
  • 3
  • 10
13
votes
6 answers

How to integrate Phaser into React

I've got a React application created with create-react-app and I'm trying to integrate Phaser 3 as well. I followed this guide to get started. I've got the canvas rendering the text but loading images in the preload does not seem to be working. I…
Taylor N
  • 500
  • 1
  • 3
  • 15
1
2 3
99 100