Пример #1
0
 public void turn(Direction direction) {
   this.direction = direction;
   try {
     af.repaint();
   } catch (Exception e) {
     System.out.println("Repaint exception");
   }
 }
Пример #2
0
  public void reappear() {
    try {
      Thread.sleep(1000);
    } catch (Exception e) {
      System.out.println("Exception");
    }
    x = new Random().nextInt(bf.getDimentionX()) * 64;
    y = new Random().nextInt(bf.getDimentionY()) * 64;

    af.repaint();
  }
Пример #3
0
  public void destroy() {
    if (this instanceof Tiger) {
      Tiger t = (Tiger) this;
      if (t.getArmor() > 0) {
        t.setArmor(0);
        return;
      } else {
        t.setArmor(1);
      }
    }

    x = -100;
    y = -100;
    af.repaint();
    reappear();
  }