示例#1
0
 public void createBug(int bug) {
   AnimatedLabel temp = null;
   if (bug == SMALLFLY) temp = new SmallFly(this);
   else if (bug == BLUEFLY) temp = new BlueFly(this);
   else if (bug == WASP) temp = new Wasp(this);
   temp.setVisible(false);
   aLabel.add(temp);
   sendCursorLocation(temp); // Tells certain bugs where you are
   add(temp);
   moveToBack(backgroundLabel);
 }
示例#2
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);
  }
示例#3
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);
  }
示例#4
0
 public void remove(AnimatedLabel label) {
   label.setVisible(false);
   super.remove(label);
   aLabel.remove(label);
 }