Skip to content

Commit

Permalink
clean up greece ending: veera kalakota
Browse files Browse the repository at this point in the history
  • Loading branch information
VeeraKalakota committed Feb 24, 2025
1 parent a415d73 commit e18d132
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions assets/js/platformer/PlayerGreece.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,25 +110,25 @@ export class PlayerGreece extends PlayerBase {
GameControl.transitionToLevel(GameEnv.levels[index]);
break
}
console.log("finish line checks")
console.log(GameEnv.gameObjects)
var collectedCoin
if (collectedCoin == false){
for (let obj of GameEnv.gameObjects) {
console.log(obj.jsonifiedElement.id)
if (obj.jsonifiedElement.id === "coin") {
collectedCoin = false
console.log("coin not collected not advancing to next lvl")
return;
}
}
}
collectedCoin = true
console.log("player has item to exit lvl")
// Transition to the next level when touching the flag
const index = GameEnv.levels.findIndex(level => level.tag === "Quidditch")
GameControl.transitionToLevel(GameEnv.levels[index]);
//above code were you transition levels is broken and crashes the game when ran
// console.log("finish line checks")
// console.log(GameEnv.gameObjects)
// var collectedCoin
// if (collectedCoin == false){
// for (let obj of GameEnv.gameObjects) {
// console.log(obj.jsonifiedElement.id)
// if (obj.jsonifiedElement.id === "coin") {
// collectedCoin = false
// console.log("coin not collected not advancing to next lvl")
// return;
// }
// }
// }
// collectedCoin = true
// console.log("player has item to exit lvl")
// // Transition to the next level when touching the flag
// const index = GameEnv.levels.findIndex(level => level.tag === "Quidditch")
// GameControl.transitionToLevel(GameEnv.levels[index]);
// //above code were you transition levels is broken and crashes the game when ran
break;
case "cerberus": // Note: Goomba.js and Player.js could be refactored
// 1. Player jumps on goomba, interaction with Goomba.js
Expand Down

0 comments on commit e18d132

Please # to comment.