image

Tommy Leung from Ourcade writes: "Are you using modern JavaScript and splitting your Phaser 3 game code into multiple files? 👏

One common best practice is to put the UI code in a separate Scene.

But then how are you supposed to give the UI Scene information like player health or score?

How would a pause button in the UI Scene tell the Game Scene to pause?

One solution is to pass data using events.

The easiest way to implement this is to use the EventEmitter instance from this.game.events but…"

Read More