private void move() {
		switch (dir) {
			case 0:
				if (x > player.getX()) {
					left();
				}
				if (x < player.getX()-20) {
					right();
				}
				break;
			case 2:
				if (x > player.getX()) {
					left();
				}
				if (x < player.getX()) {
					right();
				}
				break;
			default:
				break;
		}
	}