diff --git a/src/pong.ts b/src/pong.ts index d46b19a..db79bcc 100644 --- a/src/pong.ts +++ b/src/pong.ts @@ -256,10 +256,11 @@ class PongCore { // Randomly move the bot paddle when ball not towards it botIdle(player: Paddle) { - if (player.idleCounter < 10) { - player.idleCounter++; + player.idleCounter++; + if (player.idleCounter < 20) return; - } + else + player.idleCounter = 0; let direction: number = Math.floor(Math.random() * 3); switch (direction) { case 0: