I created a simple Nibbles (Snakes) game and everything works perfectly.
However, when I copy everything over to my mac (develop on a PC) and compile the same java files, the keyAdapter event listener for moving my snake around doesn't respond.
I'm not sure what is wrong.
here's the snippet, but if anyone would be willing to take a look at the whole program, I could send that privately. THANKS!
getThis().addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent event) {
if(event.getKeyCode() == KeyEvent.VK_UP)
if(!glass.game.getDirection().equals("D"))
glass.game.setDirection("U");
if(event.getKeyCode() == KeyEvent.VK_DOWN)
if(!glass.game.getDirection().equals("U"))
glass.game.setDirection("D");
if(event.getKeyCode() == KeyEvent.VK_LEFT)
if(!glass.game.getDirection().equals("R"))
glass.game.setDirection("L");
if(event.getKeyCode() == KeyEvent.VK_RIGHT)
if(!glass.game.getDirection().equals("L"))
glass.game.setDirection("R");
}
});