コード例 #1
0
  public void processFire(Bullet bullet) throws Exception {
    this.bullet = bullet;

    while ((bullet.getX() > -15 && bullet.getX() < battleField.getBF_WIDTH())
        && (bullet.getY() > -15 && bullet.getY() < battleField.getBF_HEIGHT())) {
      if (bullet.getDirection() == Direction.UP) {
        bullet.updateY(-step);
      } else if (bullet.getDirection() == Direction.DOWN) {
        bullet.updateY(step);
      } else if (bullet.getDirection() == Direction.LEFT) {
        bullet.updateX(-step);
      } else {
        bullet.updateX(step);
      }
      if (processInterception() == true) {
        bullet.destroy();
      }
      repaintFire();
    }
  }