예제 #1
0
  public void createGnat(AnimatedLabel label) {
    AnimatedLabel temp;
    temp = new Gnat(GNAT, this);
    sendCursorLocation(temp); // Tells certain bugs where you are
    aLabel.add(temp);
    add(temp);
    temp.setLocation(
        label.getX() + (label.getWidth() - temp.getWidth()) / 2,
        label.getY() + (label.getHeight() - temp.getHeight()) / 2);

    moveToBack(backgroundLabel);
  }
예제 #2
0
  public void createBlueShots(AnimatedLabel label) {
    AnimatedLabel temp;
    for (int i = 0; i < 4; i++) {
      if (i == 0) temp = new BlueShot(BLUESHOT1, this); // TOP LEFT
      else if (i == 1) temp = new BlueShot(BLUESHOT2, this); // TOP RIGHT
      else if (i == 2) temp = new BlueShot(BLUESHOT3, this); // BOTTOM RIGHT
      else temp = new BlueShot(BLUESHOT4, this); // BOTTOM LEFT

      sendCursorLocation(temp); // Tells certain bugs where you are
      aLabel.add(temp);
      add(temp);
      temp.setLocation(
          label.getX() + (label.getWidth() - temp.getWidth()) / 2,
          label.getY() + (label.getHeight() - temp.getHeight()) / 2);
    }
    moveToBack(backgroundLabel);
  }