I ran Main.java and started controlling PacMan. I input "RIGHT" and he went "RIGHT". But when I input "UP" I got this output from Eclipse: Exception in thread "main" java.util.NoSuchElementException at java.base/java.util.Scanner.throwFor(Scanner.java:937) at java.base/java.util.Scanner.next(Scanner.java:1478) at Game.Game.gameTick(Game.java:39) at Game.Main.main(Main.java:16)
The solution was to move the Scanner from gameTick() in Game.java to Main.java. Constant opening and closing the Scanner causes the problem