public void runGame() { while (!world.endGame()) { // System.out.println("Game playing. Making move."); int action = -1; if (mousetype == GREEDY) { action = world.mouseAction(); } else if (mousetype == SMART) { action = policy.getBestAction(world.getState()); } else { System.err.println("Invalid mouse type:" + mousetype); } world.getNextState(action); // a.updateBoard(); try { sleep(delay); } catch (InterruptedException e) { System.out.println("interrupted."); } } // turn off gameOn flag if only single game if (single) gameOn = false; }
public void resetGame() { world.resetState(); }
public void makeMove() { world.moveMouse(); world.moveCat(); }