Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/maps/random/alpine_lakes.js
Show First 20 Lines • Show All 245 Lines • ▼ Show 20 Lines | |||||
var numLakes = scaleByMapSize(5, 16); | var numLakes = scaleByMapSize(5, 16); | ||||
for (var i = 0; i < numLakes; ++i) | for (var i = 0; i < numLakes; ++i) | ||||
{ | { | ||||
lakeAreaLen = lakeAreas.length; | lakeAreaLen = lakeAreas.length; | ||||
if (!lakeAreaLen) | if (!lakeAreaLen) | ||||
break; | break; | ||||
chosenPoint = lakeAreas[randInt(lakeAreaLen)]; | chosenPoint = pickRandom(lakeAreas); | ||||
placer = new ChainPlacer(1, floor(scaleByMapSize(4, 8)), floor(scaleByMapSize(40, 180)), 0.7, chosenPoint[0], chosenPoint[1]); | placer = new ChainPlacer(1, floor(scaleByMapSize(4, 8)), floor(scaleByMapSize(40, 180)), 0.7, chosenPoint[0], chosenPoint[1]); | ||||
var terrainPainter = new LayeredPainter( | var terrainPainter = new LayeredPainter( | ||||
[tShore, tWater, tWater], // terrains | [tShore, tWater, tWater], // terrains | ||||
[1, 3] // widths | [1, 3] // widths | ||||
); | ); | ||||
var elevationPainter = new SmoothElevationPainter(ELEVATION_SET, -5, 5); | var elevationPainter = new SmoothElevationPainter(ELEVATION_SET, -5, 5); | ||||
var newLake = createAreas( | var newLake = createAreas( | ||||
▲ Show 20 Lines • Show All 152 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator