diff --git a/game.js b/game.js index dd3edba..6afa77c 100644 --- a/game.js +++ b/game.js @@ -126,21 +126,27 @@ var MENU = { } function runGameSimulation(){ - gameState=TESTING - generateBotQueue() - //console.log(BOT_QUEUE) - if (BOT_QUEUE.length>0) { - BOT_TAPE=BOT_QUEUE[0] - } else { - BOT_TAPE="BR" + if (gameState!==PAUSED) { + gameState=TESTING + generateBotQueue() + //console.log(BOT_QUEUE) + if (BOT_QUEUE.length>0) { + BOT_TAPE=BOT_QUEUE[0] + } else { + BOT_TAPE="BR" + } + BOT_STATE=ALIVE + gameState=WAITING + BOT_X=gameStage.start.x + BOT_Y=gameStage.start.y + BOT_PREVX=BOT_X + BOT_PREVY=BOT_Y + BOT_DIR=RIGHT + gameState=RUNNING + if (gameSpeed===-1) { + gameSpeed=1000/1 + } } - BOT_STATE=ALIVE - gameState=WAITING - BOT_X=gameStage.start.x - BOT_Y=gameStage.start.y - BOT_PREVX=BOT_X - BOT_PREVY=BOT_Y - BOT_DIR=RIGHT gameState=RUNNING for (var i=0;i