Exemplo n.º 1
0
 public MapArea generate()
 {
     MapArea map = new MapArea (width, height);
     for (var y=0; y<height; y++) {
         for (var x=0; x<width; x++) {
             map.setHeightAt(x, y, RandomGenerator.generate(min, max));
         }
     }
     return map;
 }
Exemplo n.º 2
0
 public void call(MapArea map)
 {
     int height = map.height;
     int width = map.width;
     for (var y=0; y<height; y++) {
         for (var x=0; x<width; x++) {
             float tile_h = map.getHeightAt(x, y);
             if ((greater_than && tile_h > h) || (!greater_than && tile_h < h)) {
                 map.setHeightAt(x, y, h);
             }
         }
     }
 }