예제 #1
0
 public int battleFieldScanner() {
   for (int fieldX = 0; fieldX < bf.getDimentionX(); fieldX++) {
     for (int fieldY = 0; fieldY < bf.getDimentionY(); fieldY++)
       if ((af.getQuadrantString(fieldX, fieldY).equals(enemyTankPosition()))
           || (bf.scanQuadrant2(fieldY, fieldX) instanceof Rock)) {
         return fieldX + 1;
       }
   }
   return 0;
 }
예제 #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();
  }