@Override
	public void update(KeyEvent keyEvent) {
		//System.out.println(event.getKeyCode());
		if (keyEvent.getKeyCode() == 37)
		{
			setDir(Direction.LEFT);
		}

		if (keyEvent.getKeyCode() == 39)
		{
			setDir(Direction.RIGHT);

		}
		if (keyEvent.getKeyCode() == 38)
		{
			setDir(Direction.UP);
		}
		if (keyEvent.getKeyCode() == 40)
		{
			setDir(Direction.DOWN);
		}

		if (keyEvent.getKeyCode() == 82) //R
		{
			setRestart(true);
		}
	}