class SceneA extends Phaser.Scene {
super({ key: "SceneA" });
this.load.image("bg", "https://assets.codepen.io/9367036/forest1.jpg");
let background = this.add.image(0, 0, "bg").setOrigin(0, 0);
background.displayWidth = config.width;
background.displayHeight = config.height;
let playText = this.add.text(400, 300, "Scène B", {
backgroundColor: "#000000",
padding: { x: 20, y: 5 },
playText.setInteractive({ useHandCursor: true });
playText.once("pointerdown", () => {
const fx = this.cameras.main.postFX.addWipe();
onUpdate: (progress) => {
class SceneB extends Phaser.Scene {
super({ key: "SceneB" });
this.load.image("bg2", "https://assets.codepen.io/9367036/forest3.jpg");
let background = this.add.image(0, 0, "bg2").setOrigin(0, 0);
background.displayWidth = config.width;
background.displayHeight = config.height;
let playText = this.add.text(400, 300, "Scène A", {
backgroundColor: "#ffffff",
padding: { x: 20, y: 5 },
playText.setInteractive({ useHandCursor: true });
playText.once("pointerdown", () => {
const fx = this.cameras.main.postFX.addWipe();
onUpdate: (progress) => {
const game = new Phaser.Game(config);