Exemplo n.º 1
0
  public void move() {
    vCat.set(
        pointX - halfwidth + 20,
        pointY - halfheight + 30,
        pointX + halfwidth - 20,
        pointY + halfheight - 30);
    if (pointX + halfwidth > xMax) {
      speedX = -speedX;
      pointX = xMax - halfwidth;
      ori_state = CAT_LEFT;
      stage++;
    } else if (pointX - halfwidth < xMin) {
      speedX = -speedX;
      pointX = xMin + halfwidth;
      ori_state = CAT_RIGHT;
      stage++;
      // update();
    }
    if (pointY + halfheight > yMax) {

    } else if (pointY - halfheight < yMin) {

    }

    speedY -= 0.098 * 3;
    pointX += speedX;
    pointY -= speedY;
    cat_state = ori_state + ani_state;
    weapon.update();
  }