Number of decorations scales appropriately with preset size

This commit is contained in:
Jayant Jain 2014-07-21 00:48:28 +05:30
parent dce6254d4a
commit 3df2de8bec

View file

@ -172,8 +172,9 @@ module.exports = class TerrainRandomizeModal extends ModalView
continue continue
randomizeDecorations: (preset, presetSize)-> randomizeDecorations: (preset, presetSize)->
if presetSize is presetSizes['small'] then sizeFactor = 1 else sizeFactor = 2
for name, decoration of preset.decorations for name, decoration of preset.decorations
for num in _.range(_.random(decoration.num[0], decoration.num[1])) for num in _.range(sizeFactor * _.random(decoration.num[0], decoration.num[1]))
center = { center = {
'x':_.random(decoration.width, presetSize.x - decoration.width), 'x':_.random(decoration.width, presetSize.x - decoration.width),
'y':_.random(decoration.height, presetSize.y - decoration.height) 'y':_.random(decoration.height, presetSize.y - decoration.height)