Skip to content

Commit

Permalink
updated examples to restart scene
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Westover <[email protected]>
  • Loading branch information
scottwestover committed May 3, 2024
1 parent 155d79b commit 827753e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/3.80/scene-transition-bitmap-mask/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class MainScene extends Phaser.Scene {
])
.then(() => {
console.log('scene transition done');
this.time.delayedCall(500, () => this.scene.restart());
})
.catch(() => undefined);
}
Expand Down
5 changes: 4 additions & 1 deletion examples/3.80/scene-transition-geometry-mask/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},
});
}
}
Expand Down

0 comments on commit 827753e

Please sign in to comment.