Skip to content

Commit ca79179

Browse files
authored
Merge pull request #129 from casonpollak/VeErA
change caveman sprite for winter level - veera kalakota
2 parents 9c55562 + 8c55031 commit ca79179

File tree

4 files changed

+30
-28
lines changed

4 files changed

+30
-28
lines changed

assets/js/platformer/GameSetterWinter.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@ const assets = {
310310
hitbox: { widthPercentage: 0.0, heightPercentage: 0.2 }
311311
},
312312
Snowman: {
313-
src: "/images/platformer/caveman.png",
314-
width: 308,
315-
height: 327,
313+
src: "/images/platformer/sprites/goomba.png",
314+
width: 228,
315+
height: 177,
316316
scaleSize: 60,
317317
speedRatio: 0.7,
318318
xPercentage: 0.6,
@@ -477,7 +477,7 @@ const assets = {
477477
{ name: 'blocks', id: 'jumpPlatform', class: BlockPlatform, data: assets.platforms.boxendright, xPercentage: 0.789, yPercentage: 0.73 },
478478
{ name: 'trash', id: 'trash', class: Trash, data: assets.obstacles.trash, xPercentage: 0.0632, yPercentage: 0.31},
479479
{ name: 'trash', id: 'trash', class: Trash, data: assets.obstacles.trash, xPercentage: 0.36, yPercentage: 0.63},
480-
{ name: 'trash', id: 'trash', class: Trash, data: assets.obstacles.trash, xPercentage: 0.565, yPercentage: 0.42},
480+
{ name: 'trash', id: 'trash', class: Trash, data: assets.obstacles.trash, xPercentage: 0.565, yPercentage: 0.4},
481481
{ name: 'trash', id: 'trash', class: Trash, data: assets.obstacles.trash, xPercentage: 0.72, yPercentage: 0.58},
482482
{ name: 'owl', id: 'owl', class: Owl, data: assets.enemies.Owl, xPercentage: 0.3, minPosition: 0.05 },
483483
{ name: 'owl', id: 'owl', class: Owl, data: assets.enemies.Owl, xPercentage: 0.8, minPosition: 0.05 },

assets/js/platformer/PlayerGreece.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -111,25 +111,25 @@ export class PlayerGreece extends PlayerBase {
111111
GameControl.transitionToLevel(GameEnv.levels[index]);
112112
break;
113113
}
114-
console.log("finish line checks")
115-
console.log(GameEnv.gameObjects)
116-
var collectedCoin
117-
if (collectedCoin == false){
118-
for (let obj of GameEnv.gameObjects) {
119-
console.log(obj.jsonifiedElement.id)
120-
if (obj.jsonifiedElement.id === "coin") {
121-
collectedCoin = false
122-
console.log("coin not collected not advancing to next lvl")
123-
return;
124-
}
125-
}
126-
}
127-
collectedCoin = true
128-
console.log("player has item to exit lvl")
129-
// Transition to the next level when touching the flag
130-
const index = GameEnv.levels.findIndex(level => level.tag === "Water")
131-
GameControl.transitionToLevel(GameEnv.levels[index]);
132-
//above code were you transition levels is broken and crashes the game when ran
114+
// console.log("finish line checks")
115+
// console.log(GameEnv.gameObjects)
116+
// var collectedCoin
117+
// if (collectedCoin == false){
118+
// for (let obj of GameEnv.gameObjects) {
119+
// console.log(obj.jsonifiedElement.id)
120+
// if (obj.jsonifiedElement.id === "coin") {
121+
// collectedCoin = false
122+
// console.log("coin not collected not advancing to next lvl")
123+
// return;
124+
// }
125+
// }
126+
// }
127+
// collectedCoin = true
128+
// console.log("player has item to exit lvl")
129+
// // Transition to the next level when touching the flag
130+
// const index = GameEnv.levels.findIndex(level => level.tag === "Quidditch")
131+
// GameControl.transitionToLevel(GameEnv.levels[index]);
132+
// //above code were you transition levels is broken and crashes the game when ran
133133
break;
134134
case "cerberus": // Note: Goomba.js and Player.js could be refactored
135135
// 1. Player jumps on goomba, interaction with Goomba.js

assets/js/platformer/PlayerWinter.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,13 @@ export class PlayerWinter extends PlayerBase {
135135
this.state.movement.left = false;
136136
this.state.movement.right = true;
137137
}
138-
this.canvasHeight = this.canvasHeight * 0.8
139-
this.canvasWidth = this.canvasWidth * 0.8
140-
GameEnv.customTimeout(() => {
141-
this.x = GameEnv.innerWidth + 1; // handles alert to next level
142-
}, 2000);
138+
this.x = this.collisionData.newX;
139+
this.canvas.style.zIndex = '20'
140+
this.canvasHeight = this.canvasHeight * 0.9
141+
this.canvasWidth = this.canvasWidth * 0.9
142+
setTimeout(() => {
143+
GameControl.transitionToLevel(GameEnv.levels[GameEnv.levels.indexOf(GameEnv.currentLevel) + 1]);
144+
}, 1000);
143145
break;
144146
case "snowman": // Note: Goomba.js and Player.js could be refactored
145147
// 1. Player jumps on goomba, interaction with Goomba.js
49 KB
Loading

0 commit comments

Comments
 (0)