From 95f4b6ca5e9bfacecb84dac328514b1237b16d82 Mon Sep 17 00:00:00 2001 From: RossaMania Date: Sat, 30 Nov 2024 21:05:03 -0600 Subject: [PATCH] Update enemy.counter in changeDir function to allow for greater movement variability --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index e558637..fb31141 100644 --- a/app.js +++ b/app.js @@ -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 = () => {