Ejemplo n.º 1
0
  /**
   * Lanza un único disparo básico
   *
   * @param shooter - El shooter que realizó el disparo
   */
  public static Basic shootOneBasicWeapon(GameObject shooter) {
    Basic basic = new Basic(shooter, 0, 0);

    int x = (int) (shooter.getX() - basic.getWidth());
    int y = (int) (shooter.getY() + shooter.getHeight() / 2);

    if (shooter instanceof CampaignShip) {
      x += shooter.getWidth() + basic.getWidth();
      y -= (shooter.getHeight() / 2 - basic.getHeight() / 2);
    }

    addToShoots(basic, x, y);

    return basic;
  }