Skip to content

Commit

Permalink
Reset movement when run pressed
Browse files Browse the repository at this point in the history
  • Loading branch information
SamanthaSmith04 committed Sep 17, 2024
1 parent 155e9aa commit 1c7c617
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ for (i = 0; i < 5; i++) {

document.getElementById("enableCommands").addEventListener("click", (event) => {
// document.getElementById("enableCommands").disabled = true;
player.x = player_start_current_level[0];
player.y = player_start_current_level[1];

playerCol = Math.floor(player.x / 40);
playerRow = Math.floor(player.y / 40);
programText = C4C.Editor.getText();
// HERE'S THE IMPORTANT PART!!
// C4C.Interpreter.run(programText);
Expand Down Expand Up @@ -353,11 +358,16 @@ function collectJewel() {
}

function hitGuard() {
for (i = 0; i < guards.length; i++){
guards[i].setDepth(3);
}
player.setTint(0xff0000);

guardHit = true;
gameOver = true;



}

function checkGuard(playerRow, playerCol) {
Expand Down

0 comments on commit 1c7c617

Please sign in to comment.