Skip to content

Commit

Permalink
Merge pull request #82 from jm1021/main
Browse files Browse the repository at this point in the history
Change finish to water level
  • Loading branch information
jm1021 committed May 18, 2024
2 parents 323350a + 1238da7 commit 61ced2e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 10 deletions.
12 changes: 9 additions & 3 deletions assets/js/platformer3x/GameSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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" },
Expand Down Expand Up @@ -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...
Expand Down
25 changes: 18 additions & 7 deletions assets/js/platformer3x/SettingsControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/platformer/obstacles/Chest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/platformer/obstacles/Trident.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 61ced2e

Please sign in to comment.