phaser icon indicating copy to clipboard operation
phaser copied to clipboard

Adding a scene can fail in HEADLESS mode

Open samme opened this issue 2 years ago • 1 comments

Version

  • Phaser Version: 3.55.2

Description

In a headless game, if you add a scene after at least one scene manager update (I think), the scene never gets added.

Example Test Code

Here Add is printed but Hello is not.

class MyScene extends Phaser.Scene {
  create() {
    console.log("Hello");
  }
}

class BootScene extends Phaser.Scene {
  create() {
    this.time.delayedCall(100, () => {
      console.log("Add");

      this.scene.add("myScene", MyScene, true);
    });
  }
}

new Phaser.Game({
  type: Phaser.HEADLESS,
  scene: BootScene
});

Additional Information

The problem is that the headless scene manager never resets its isProcessing property.

samme avatar Jan 17 '22 21:01 samme

#5872

samme avatar Feb 05 '22 21:02 samme

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

photonstorm avatar Nov 23 '22 16:11 photonstorm