Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/maps/random/islands.js
Show First 20 Lines • Show All 204 Lines • ▼ Show 20 Lines | |||||
log("Creating big islands..."); | log("Creating big islands..."); | ||||
var numIslands = scaleByMapSize(4, 14); | var numIslands = scaleByMapSize(4, 14); | ||||
for (var i = 0; i < numIslands; ++i) | for (var i = 0; i < numIslands; ++i) | ||||
{ | { | ||||
landAreaLen = landAreas.length; | landAreaLen = landAreas.length; | ||||
if (!landAreaLen) | if (!landAreaLen) | ||||
break; | break; | ||||
chosenPoint = landAreas[randInt(landAreaLen)]; | chosenPoint = pickRandom(landAreas); | ||||
// create big islands | // create big islands | ||||
placer = new ChainPlacer(floor(scaleByMapSize(4, 8)), floor(scaleByMapSize(8, 14)), floor(scaleByMapSize(25, 60)), 0.07, chosenPoint[0], chosenPoint[1], scaleByMapSize(30,70)); | placer = new ChainPlacer(floor(scaleByMapSize(4, 8)), floor(scaleByMapSize(8, 14)), floor(scaleByMapSize(25, 60)), 0.07, chosenPoint[0], chosenPoint[1], scaleByMapSize(30,70)); | ||||
//placer = new ClumpPlacer(floor(hillSize*randFloat(0.9,2.1)), 0.80, 0.1, 0.07, chosenPoint[0], chosenPoint[1]); | //placer = new ClumpPlacer(floor(hillSize*randFloat(0.9,2.1)), 0.80, 0.1, 0.07, chosenPoint[0], chosenPoint[1]); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
Show All 23 Lines | |||||
log("Creating small islands..."); | log("Creating small islands..."); | ||||
numIslands = scaleByMapSize(6, 18) * scaleByMapSize(1,3); | numIslands = scaleByMapSize(6, 18) * scaleByMapSize(1,3); | ||||
for (var i = 0; i < numIslands; ++i) | for (var i = 0; i < numIslands; ++i) | ||||
{ | { | ||||
landAreaLen = landAreas.length; | landAreaLen = landAreas.length; | ||||
if (!landAreaLen) | if (!landAreaLen) | ||||
break; | break; | ||||
chosenPoint = landAreas[randInt(0, landAreaLen)]; | chosenPoint = pickRandom(landAreas); | ||||
placer = new ChainPlacer(floor(scaleByMapSize(4, 7)), floor(scaleByMapSize(7, 10)), floor(scaleByMapSize(16, 40)), 0.07, chosenPoint[0], chosenPoint[1], scaleByMapSize(22,40)); | placer = new ChainPlacer(floor(scaleByMapSize(4, 7)), floor(scaleByMapSize(7, 10)), floor(scaleByMapSize(16, 40)), 0.07, chosenPoint[0], chosenPoint[1], scaleByMapSize(22,40)); | ||||
terrainPainter = new LayeredPainter( | terrainPainter = new LayeredPainter( | ||||
[tMainTerrain, tMainTerrain], // terrains | [tMainTerrain, tMainTerrain], // terrains | ||||
[2] // widths | [2] // widths | ||||
); | ); | ||||
elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 6); | elevationPainter = new SmoothElevationPainter(ELEVATION_SET, 3, 6); | ||||
createAreas( | createAreas( | ||||
▲ Show 20 Lines • Show All 311 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator