Beispiel #1
0
 public void handleMilestones(Tile t) {
   int lastTile = (15 * 15);
   System.out.println(Tile.exposedCount);
   if (Tile.exposedCount == 20 || eventQueue[0]) {
     if (!t.containsFat()) {
       t.addEntity("body");
       eventQueue[0] = false;
     } else eventQueue[0] = true;
   }
   if (Tile.exposedCount == lastTile) {
     t.entities.clear();
     t.addEntity("altar");
   }
 }
 private Tile getSpecialTile(int x, int y, int val) {
   Tile tile = EmptyTile.instance;
   if (layer == 0) {
     tile = new Tile(Walls.grass);
     Switch sw = new Switch(0, val);
     sw.setPosition(0.2, 0.4, 0.9);
     tile.addEntity(-1, sw);
   }
   if (layer == -1) {
     tile = new Tile(Walls.dungeonFloor);
     Switch sw = new Switch(0, val);
     sw.setPosition(0.5, 0.4, 0.9);
     tile.addEntity(-1, sw);
   }
   return tile;
 }
Beispiel #3
0
 private void growTrees() {
   for (Tile[] tileRow : tiles) {
     for (Tile tile : tileRow) {
       Random r = new Random();
       if (1 == r.nextInt(3 * tiles.length * tiles[0].length)
           && !(tile.contains("tree") || tile.containsFat())) {
         tile.addEntity("tree");
         tile.removeOverlap();
       }
     }
   }
 }