diff --git a/assets/js/platformer3x/GameSetup.js b/assets/js/platformer3x/GameSetup.js index cce4f48b..0ba92ed0 100644 --- a/assets/js/platformer3x/GameSetup.js +++ b/assets/js/platformer3x/GameSetup.js @@ -8,10 +8,10 @@ import BackgroundCoral from './BackgroundCoral.js'; import BackgroundMountains from './BackgroundMountains.js'; import BackgroundTransitions from './BackgroundTransitions.js'; import BackgroundClouds from './BackgroundClouds.js'; +import BackgroundFish from './BackgroundFish.js'; import BackgroundWinter from './BackgroundWinter.js'; import BackgroundNarwhal from './BackgroundNarwhal.js'; import BackgroundSnow from './BackgroundSnow.js'; -import BackgroundFish from './BackgroundFish.js'; import Platform from './Platform.js'; import JumpPlatform from './JumpPlatform.js'; import PlayerHills from './PlayerHills.js'; @@ -244,6 +244,13 @@ const GameSetup = { height: 300, scaleSize: 150, }, + chest: { + src: "/images/platformer/obstacles/Chest.png", + hitbox: { widthPercentage: 0.5, heightPercentage: 0.5 }, + width: 300, + height: 300, + scaleSize: 100, + }, coin: { src: "/images/platformer/obstacles/coin.png" }, snowflake: { src: "/images/platformer/obstacles/snowflake.png" }, star: { src: "/images/platformer/obstacles/star.png" }, @@ -854,14 +861,13 @@ const GameSetup = { { name: 'coin', id: 'coin', class: Coin, data: this.assets.obstacles.coin, xPercentage: 0.2575, yPercentage: 0.75 }, { name: 'coin', id: 'coin', class: Coin, data: this.assets.obstacles.coin, xPercentage: 0.5898, yPercentage: 0.900 }, { name: 'mario', id: 'player', class: PlayerHills, data: this.assets.players.mario }, - { name: 'tube', id: 'finishline', class: FinishLine, data: this.assets.obstacles.tube, xPercentage: 0.85, yPercentage: 0.65 }, + { name: 'Chest', id: 'finishline', class: FinishLine, data: this.assets.obstacles.chest, xPercentage: 0.85, yPercentage: 0.65 }, { name: 'miniEnd', id: 'background', class: BackgroundTransitions, data: this.assets.transitions.miniEnd }, ]; let waterGameObjects = allWaterGameObjects.filter(obj => !obj.difficulties || obj.difficulties.includes(difficulty)); // Water Game Level added to the GameEnv ... new GameLevel({ tag: "water", callback: this.playerOffScreenCallBack, objects: waterGameObjects }); - // Quidditch Game Level definition... const quidditchGameObjects = [ // GameObject(s), the order is important to z-index... diff --git a/assets/js/platformer3x/SettingsControl.js b/assets/js/platformer3x/SettingsControl.js index 2acb79cf..62e1d0fc 100644 --- a/assets/js/platformer3x/SettingsControl.js +++ b/assets/js/platformer3x/SettingsControl.js @@ -528,18 +528,29 @@ export class SettingsControl extends LocalStorage{ var hintsButton = document.createElement("input") hintsButton.type = "checkbox" - hintsButton.checked = true - - hintsButton.addEventListener("click", () => { - const hints = document.getElementsByClassName("fun_facts")[0] + const hintsDiv = document.getElementsByClassName("fun_facts")[0] + console.log(localStorage.getItem("show_hints")) + if (localStorage.getItem("show_hints") == true) { + hintsDiv.style.display = "unset" + hintsButton.checked = true + } + else { + hintsDiv.style.display = "none" + hintsButton.checked = false + } + + hintsButton.addEventListener("click", () => { if (!hintsButton.checked) { - hints.style.display = "none" + hintsDiv.style.display = "none" + localStorage.setItem("show_hints", false) } else { - hints.style.display = "unset" + hintsDiv.style.display = "unset" + localStorage.setItem("show_hints", true) } - }) + console.log(localStorage.getItem("show_hints")) + }) hintsSection.append(hintsButton) document.getElementById("sidebar").append(hintsSection) diff --git a/images/platformer/backgrounds/congratulations!!!.png b/images/platformer/backgrounds/congratulations!!!.png new file mode 100644 index 00000000..3752bebe Binary files /dev/null and b/images/platformer/backgrounds/congratulations!!!.png differ diff --git a/images/platformer/obstacles/Chest.png b/images/platformer/obstacles/Chest.png new file mode 100644 index 00000000..207690a6 Binary files /dev/null and b/images/platformer/obstacles/Chest.png differ diff --git a/images/platformer/obstacles/Trident.png b/images/platformer/obstacles/Trident.png new file mode 100644 index 00000000..9724d62a Binary files /dev/null and b/images/platformer/obstacles/Trident.png differ