Skip to content

Commit

Permalink
Update enemy.counter in changeDir function to allow for greater movem…
Browse files Browse the repository at this point in the history
…ent variability
  • Loading branch information
RossaMania committed Dec 1, 2024
1 parent 8024e22 commit 95f4b6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ changeDir = (enemy) => {
} // vertical direction change based on ghost position and pacman position (up or down)

// change ghost counter value to random number + 2 so it goes at least 2 spaces before changing direction
enemy.counter = (Math.random() * 1) + 2;
enemy.counter = (Math.random() * 4) + 2;
}

move = () => {
Expand Down

0 comments on commit 95f4b6c

Please sign in to comment.