Skip to content

Commit

Permalink
someone fixed my goomba and the world is happy
Browse files Browse the repository at this point in the history
  • Loading branch information
katiek27 committed Dec 19, 2023
1 parent 8b4d6ab commit 84b43de
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ title: Teacher 2.0
description: "August 2023 to June 2024"
owner_name: Katie Kim
github_username: katiek27
github_repo: "teachtwo"
github_repo: "teachport"
baseurl: "/teachtwo"
future: true
remote_theme: jekyll/minima
Expand Down
2 changes: 1 addition & 1 deletion assets/js/platformer/GameControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const GameControl = {
// Get current level
GameEnv.update();
const currentLevel = GameEnv.currentLevel;

// currentLevel is defined
if (currentLevel) {
// run the isComplete callback function
Expand Down
9 changes: 5 additions & 4 deletions assets/js/platformer/Player.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import GameEnv from './GameEnv.js';
import Character from './Character.js';
import deathController from './Death.js';
import GameControl from './GameControl.js'

// export async function gameOverCallBack() {
// const id = document.getElementById("gameOver");
Expand Down Expand Up @@ -256,7 +256,7 @@ export class Player extends Character{
if (this.collisionData.touchPoints.other.id === "enemy") {
// Collision with the left side of the Enemy
if (this.collisionData.touchPoints.other.left) {
deathController.setDeath(1);
GameControl.transitionToLevel(GameEnv.levels[GameEnv.levels.indexOf(GameEnv.currentLevel)]);
this.destroy();
// waitForButton();
// homeScreenCallback();
Expand All @@ -265,7 +265,7 @@ export class Player extends Character{
}
// Collision with the right side of the Enemy
if (this.collisionData.touchPoints.other.right) {
deathController.setDeath(1);
GameControl.transitionToLevel(GameEnv.levels[GameEnv.levels.indexOf(GameEnv.currentLevel)]);
this.destroy();
// waitForButton();
// homeScreenCallback();
Expand All @@ -275,7 +275,8 @@ export class Player extends Character{
// Collision with the top of the Enemy
if (this.collisionData.touchPoints.other.ontop) {
this.y -= (this.bottom * 0.33);
this.collisionData.touchPoints.other.destroy();
GameControl.transitionToLevel(GameEnv.levels[GameEnv.levels.indexOf(GameEnv.currentLevel)]);
// this.collisionData.touchPoints.other.destroy();
console.log("topenemy");
}
}
Expand Down

0 comments on commit 84b43de

Please sign in to comment.