public void update() {
		time++;
		// if time % 60 == 0 / = 1 second
		if (time % (random.nextInt(50) + 60) == 0) {
			xa = (random.nextInt(3) - 1) * speed; // speed=5 => -1, 0, 1 ;
													// speed=0.5 => -0.5, 0, 0.5
			ya = (random.nextInt(3) - 1) * speed;
			if (random.nextInt(4) == 0) {
				xa = 0;
				ya = 0;
			}
		}
		if (walking)
			animSprite.update();
		else
			animSprite.setFrame(0);

		if (ya < 0) {
			animSprite = up;
			dir = Direction.UP;
		} else if (ya > 0) {
			animSprite = down;
			dir = Direction.DOWN;
		}
		if (xa < 0) {
			animSprite = left;
			dir = Direction.LEFT;
		} else if (xa > 0) {
			animSprite = right;
			dir = Direction.RIGHT;
		}

		if (xa != 0 || ya != 0) {
			move(xa, ya);
			walking = true;
		} else {
			walking = false;
		}
	}