Questions tagged [phaserjs]

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

50 questions
1
vote
1 answer

Phaser.js Timed callback from a child in a group

I would like for a child from a physics group destroy itself after ~2 seconds, along with other things, and I was thinking along the lines of a function callback which happens two seconds after the creation of the child, but I'm not sure how to…
Vatsa Pandey
  • 583
  • 2
  • 12
1
vote
1 answer

how to move multiple scenes side-by-side

My game has multiple screens, like side-by-side rooms and I'm trying to allow user to drag between them, like presentation slides. So I'm doing it by each room as a different scene, just for organizing the map in different files. import Phaser from…
anderlaini
  • 1,593
  • 2
  • 24
  • 39
1
vote
1 answer

Is Circle mask image Plugin broken?

in Phaser,I load the plugin in preload function class Main extends Phaser.Scene { constructor() { super("Main"); } preload() { this.load.plugin('rexcirclemaskimageplugin', …
aya hosny
  • 57
  • 1
  • 1
  • 6
1
vote
1 answer

Phaser change sprite rotation to the direction its going in

I have this sprite group this.photons = this.physics.add.group({ key: "photon", repeat: 11, setXY: { x: 50, y: 50, stepX: 32 }, }); this.photons.children.iterate(function (child) { child.body.bounce.set(1); …
Vatsa Pandey
  • 583
  • 2
  • 12
1
vote
1 answer

Phaser3 Game Canvas Responsive

I know starting from phaser 3 there is a ScaleManager, to do Phaser.Scale.FIT, however it not the responsive I wish for. My canvas mainly focus on the center of screen, so when resizing the browser, I want the canvas is fit the parent, and it is ok…
FeelRightz
  • 2,777
  • 2
  • 38
  • 73
1
vote
1 answer

How can I fill my new shapes red after using this.matter.add.fromVertices

I am making a small game which cuts objects in half. I need the new shapes created to be filled in red, however it is not working. Lines 94-99 are where the new shape is created, and hopefully filled in red... line 99 is where I am currently…
1
vote
2 answers

How can I add add colour to my this.matter.add.rectangle

Does anybody know how to add colour to my rectangle? I have used this.matter.add.rectangle. I am making a game which cuts shapes in half, however I can't figure out how to keep the game physics and add colour. I can add colour when taking out…
1
vote
1 answer

Phaser timer controlled text trouble

I'm trying to have some text that shows one line at a time then change scenes, using events. I'm having trouble though. Here is the code I'm using: this.query.setText('What was his job?'); var unemployed = this.add.sprite(600, 600,…
EmptyStone
  • 235
  • 1
  • 7
1
vote
1 answer

Basketball Game Phaser JS

I'm making a basketball game and the shooting doesn't seem to be working. I have spent a very long time on this and I'm almost at my deadline so I need a little bit of help. If anyone could help me that would be very appreciated. Here's the code of…
1
vote
1 answer

how can I set up a T-shaped hitbox for an umbrella?

I have started learning Phaser 3.60 and unfortunately I am stuck. I can't find a way to set up the hitbox. Exactly what I would like is to have the raindrop falling from the top down and have an umbrella that when the raindrop falls on it, it…
Drelaky
  • 23
  • 3
1
vote
1 answer

Phaser Number won't increase where I think it should

I have something of a minigame within a scene, that game is working fine, but I'm having trouble telling the rest of the code that its complete. if (this.mini == true){ this.fixed = 4; if (this.houseRepair == true){ …
EmptyStone
  • 235
  • 1
  • 7
1
vote
2 answers

Phaser Struggling to get temporary text boxes working, any chance there are for loops in phaser?

I'm trying to get some text to breifly appear, and then disappear, but I'm struggling to figure out how. What I have here is some dialogue that is triggered if a boolean is true. It has 2 timer integers, one for each dialogue. While the first one is…
EmptyStone
  • 235
  • 1
  • 7
1
vote
1 answer

Phaser Multiple lines in one text? Is there a way to set images?

For a game I'm making in Phaser, there are two things I'm concerned about. 1st. When using the setText method, or just setting a string in general, is there a way for the resulting string to have multiple lines? I'm asking because just hitting enter…
EmptyStone
  • 235
  • 1
  • 7
1
vote
1 answer

Phaser scene will not boot correctly, it just displays a empty screen

I have switched my code config to allow me to create multiple scenes and I plan to overlap scenes to create my game UI and other screens (menu, end, leaderboard...). Im just not sure why my game will not work currently when I changed my scene…
JackF99
  • 125
  • 6
1
vote
1 answer

Phaser3 no scroll bar on mobile

while working on a phaser3 project I seem to have 2 scroll bars on Desktop (inner and outer) but none on mobile. Can someone help? This is my phaser config: const config = { type: Phaser.AUTO, scale: { mode: Phaser.AUTO, …