const SIZE = 160; const sand = "beach_medit_dry"; const grass1 = "grass_temperate_a"; const grass2 = "grass_mediterranean_green_flowers"; const forestFloor = "forrestfloor"; const dirt1 = "grass_sand_75"; const dirt2 = "grass_sand_50"; const dirt3 = "dirt_brown_e"; const cliffBase = "cliff base a"; const cliffBeach = "beech_cliff_a_75"; const cliff = "cliff_face3"; const oTree = "flora_tree_oak"; const oGrass = "props/flora/grass_soft_small.xml" const oMine = "geology_stone_light"; // Initialize init(SIZE, grass1, 0); // Create classes clImpassable = createTileClass(); clRock = createTileClass(); // Paint elevation noise0 = new Noise2D(4 * SIZE/128.0); noise1 = new Noise2D(8 * SIZE/128.0); noise2 = new Noise2D(11 * SIZE/128.0); noise3 = new Noise2D(30 * SIZE/128.0); noise4 = new Noise2D(60 * SIZE/128.0); for(ix=0; ix 3.2) { setTexture(ix, iy, cliff); addToClass(ix, iy, clImpassable); } else if(maxH - minH > 2.7) { setTexture(ix, iy, cliffBase); addToClass(ix, iy, clImpassable); } else if(minH <= 0) { setTexture(ix, iy, sand); addToClass(ix, iy, clImpassable); } else { setTexture(ix, iy, grass1); } } } // Paint forest and dirt forestNoise1 = new Noise2D(20 * SIZE/128.0); forestNoise2 = new Noise2D(40 * SIZE/128.0); dirtNoise = new Noise2D(80 * SIZE/128.0); for(ix=0; ix 0) { fn = (forestNoise1.eval(x,y) + .5*forestNoise1.eval(x,y)) / 1.5; if(minH > .5 && fn < .38 && dirtNoise.eval(x,y) > .55) { if(dirtNoise.eval(x,y) > .72) { setTexture(ix, iy, dirt2); } else { setTexture(ix, iy, dirt1); } } if(fn > .6 && randFloat() < (.3 + .7 * Math.min(fn-.6, .1) / .1) ) { placeObject(oTree, 0, ix+.4+.2*randFloat(), iy+.4+.2*randFloat(), randFloat()*2*Math.PI); addToClass(ix, iy, clImpassable); if(randFloat() < .7) { setTexture(ix, iy, forestFloor); } } } } } println("Creating mines..."); group = new SimpleGroup([new SimpleObject(oMine, 3,4, 0,2)], true, clRock); createObjectGroups(group, 0, new AvoidTileClassConstraint(clImpassable, 2, clRock, 13), 12, 100 );