Beispiel #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;
 }
Beispiel #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();
  }
Beispiel #3
0
 boolean checkRight(int checkX, int checkY) {
   for (; checkX < 9; checkX++) {
     if (bf.scanQuadrant2(checkY, checkX) instanceof Rock
         || af.getQuadrantString(checkX, checkY).equals(enemyTankPosition())) {
       return true;
     }
   }
   return false;
 }