From 5e80210c73cda923cf6f403ec46d471968c14f49 Mon Sep 17 00:00:00 2001 From: Neil Kalman Date: Wed, 4 Sep 2024 15:50:33 +0300 Subject: [PATCH] add query param to change scenes --- src/main.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 725dc68..2cdb463 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,11 @@ import Phaser from 'phaser'; import KibibitLogoScene from './scenes/kibibit-logo.scene'; +import ProfileScene from './scenes/profile.scene'; + +// select scene based on url params +const urlParams = new URLSearchParams(window.location.search); +const scene = urlParams.get('scene'); const config: Phaser.Types.Core.GameConfig = { type: Phaser.AUTO, @@ -10,10 +15,13 @@ const config: Phaser.Types.Core.GameConfig = { physics: { default: 'arcade', arcade: { - gravity: { y: 200 } + gravity: { y: 500 } } }, - scene: [ KibibitLogoScene ] + // scene: [ KibibitLogoScene ] + scene: [ + scene === 'profile' ? ProfileScene : KibibitLogoScene + ] }; export default new Phaser.Game(config);