mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Number of decorations scales appropriately with preset size
This commit is contained in:
parent
dce6254d4a
commit
3df2de8bec
1 changed files with 2 additions and 1 deletions
|
@ -172,8 +172,9 @@ module.exports = class TerrainRandomizeModal extends ModalView
|
|||
continue
|
||||
|
||||
randomizeDecorations: (preset, presetSize)->
|
||||
if presetSize is presetSizes['small'] then sizeFactor = 1 else sizeFactor = 2
|
||||
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 = {
|
||||
'x':_.random(decoration.width, presetSize.x - decoration.width),
|
||||
'y':_.random(decoration.height, presetSize.y - decoration.height)
|
||||
|
|
Loading…
Reference in a new issue