From 1bc311236f9cac41bcf445851f1141cd05d4242a Mon Sep 17 00:00:00 2001 From: "Z. Cliffe Schreuders" Date: Mon, 17 Mar 2025 00:56:48 +0000 Subject: [PATCH] Implement scenario selection feature and dynamic loading of scenarios. Updated index.html to load scenarios based on URL parameters and added scenario_select.html for user interface to choose scenarios. --- index.html | 8 +- scenario_select.html | 388 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 394 insertions(+), 2 deletions(-) create mode 100644 scenario_select.html diff --git a/index.html b/index.html index 3a9daa7..0cc5dd6 100644 --- a/index.html +++ b/index.html @@ -1734,8 +1734,12 @@ this.load.image('lockpick', 'assets/objects/lockpick.png'); this.load.image('spoofing_kit', 'assets/objects/spoofing_kit.png'); - //this.load.json('gameScenarioJSON', 'assets/scenarios/biometric_breach.json'); - this.load.json('gameScenarioJSON', 'assets/scenarios/ceo_exfil.json'); + // Get scenario from URL parameter or use default + const urlParams = new URLSearchParams(window.location.search); + const scenarioFile = urlParams.get('scenario') || 'assets/scenarios/ceo_exfil.json'; + + // Load the specified scenario + this.load.json('gameScenarioJSON', scenarioFile); gameScenario = this.cache.json.get('gameScenarioJSON'); } diff --git a/scenario_select.html b/scenario_select.html new file mode 100644 index 0000000..2c1b7d7 --- /dev/null +++ b/scenario_select.html @@ -0,0 +1,388 @@ + + + + + Office Adventure Game - Scenario Selection + + + +
+

Select a Scenario

+ +
+ +
+ + +
+ + + + \ No newline at end of file