From 827753edcbe414ec89df704ed7faba60efe58a4f Mon Sep 17 00:00:00 2001 From: Scott Westover Date: Fri, 3 May 2024 11:54:55 -0400 Subject: [PATCH] updated examples to restart scene Signed-off-by: Scott Westover --- examples/3.80/scene-transition-bitmap-mask/src/main.ts | 1 + examples/3.80/scene-transition-geometry-mask/src/main.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/3.80/scene-transition-bitmap-mask/src/main.ts b/examples/3.80/scene-transition-bitmap-mask/src/main.ts index cbb2fb8..55d9267 100644 --- a/examples/3.80/scene-transition-bitmap-mask/src/main.ts +++ b/examples/3.80/scene-transition-bitmap-mask/src/main.ts @@ -79,6 +79,7 @@ class MainScene extends Phaser.Scene { ]) .then(() => { console.log('scene transition done'); + this.time.delayedCall(500, () => this.scene.restart()); }) .catch(() => undefined); } diff --git a/examples/3.80/scene-transition-geometry-mask/src/main.ts b/examples/3.80/scene-transition-geometry-mask/src/main.ts index 2c6c946..b6b9cfd 100644 --- a/examples/3.80/scene-transition-geometry-mask/src/main.ts +++ b/examples/3.80/scene-transition-geometry-mask/src/main.ts @@ -73,8 +73,11 @@ class MainScene extends Phaser.Scene { this.tweens.add({ targets: ship, - x: width, + x: width + 100, duration: 6000, + onComplete: () => { + this.scene.restart(); + }, }); } }