Fixed Grass01-Grass05 scaling issues.

This commit is contained in:
Nick Winter 2014-07-15 18:08:00 -07:00
parent 8c9c41f477
commit 03cc2d1af0
2 changed files with 10 additions and 11 deletions

View file

@ -328,7 +328,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
@baseScaleX *= -1 if @getActionProp 'flipX' @baseScaleX *= -1 if @getActionProp 'flipX'
@baseScaleY *= -1 if @getActionProp 'flipY' @baseScaleY *= -1 if @getActionProp 'flipY'
# temp, until these are re-exported with perspective # temp, until these are re-exported with perspective
floors = ['Dungeon Floor', 'Indoor Floor', 'Grass', 'Goal Trigger', 'Obstacle'] floors = ['Dungeon Floor', 'Indoor Floor', 'Grass', 'Grass01', 'Grass02', 'Grass03', 'Grass04', 'Grass05', 'Goal Trigger', 'Obstacle']
if @options.camera and @thangType.get('name') in floors if @options.camera and @thangType.get('name') in floors
@baseScaleY *= @options.camera.y2x @baseScaleY *= @options.camera.y2x

View file

@ -4,7 +4,7 @@ CocoModel = require 'models/CocoModel'
clusters = { clusters = {
'rocks': ['Rock 1', 'Rock 2', 'Rock 3', 'Rock 4', 'Rock 5', 'Rock Cluster 1', 'Rock Cluster 2', 'Rock Cluster 3'] 'rocks': ['Rock 1', 'Rock 2', 'Rock 3', 'Rock 4', 'Rock 5', 'Rock Cluster 1', 'Rock Cluster 2', 'Rock Cluster 3']
'trees': ['Tree 1', 'Tree 2', 'Tree 3', 'Tree 4'] 'trees': ['Tree 1', 'Tree 2', 'Tree 3', 'Tree 4']
'shrubs': ['Shrub 1', 'Shrub 2', 'Shrub 3'] 'shrubs': ['Shrub 1', 'Shrub 2', 'Shrub 3']
'houses': ['House 1', 'House 2', 'House 3', 'House 4'] 'houses': ['House 1', 'House 2', 'House 3', 'House 4']
'animals': ['Cow', 'Horse'] 'animals': ['Cow', 'Horse']
@ -22,8 +22,7 @@ presets = {
'grassy': { 'grassy': {
'type':'grassy' 'type':'grassy'
'borders':['Tree 1', 'Tree 2', 'Tree 3'] 'borders':['Tree 1', 'Tree 2', 'Tree 3']
'floors':['Grass'] 'floors':['Grass01', 'Grass02', 'Grass03', 'Grass04', 'Grass05']
# 'floors':['Grass01', 'Grass02', 'Grass03']
'decorations': { 'decorations': {
'house': { 'house': {
'num':[1,2] #min-max 'num':[1,2] #min-max
@ -90,7 +89,7 @@ module.exports = class TerrainRandomizeModal extends ModalView
presetType = target.attr 'data-preset-type' presetType = target.attr 'data-preset-type'
presetSize = target.attr 'data-preset-size' presetSize = target.attr 'data-preset-size'
@randomizeThangs presetType, presetSize @randomizeThangs presetType, presetSize
Backbone.Mediator.publish('randomize:terrain-generated', Backbone.Mediator.publish('randomize:terrain-generated',
'thangs': @thangs 'thangs': @thangs
) )
@hide() @hide()
@ -152,20 +151,20 @@ module.exports = class TerrainRandomizeModal extends ModalView
randomizeDecorations: (preset, presetSize)-> randomizeDecorations: (preset, presetSize)->
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(_.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)
} }
min = min =
{ {
'x':center.x - decoration.width/2 'x':center.x - decoration.width/2
'y':center.y - decoration.height/2 'y':center.y - decoration.height/2
} }
max = max =
{ {
'x':center.x + decoration.width/2 'x':center.x + decoration.width/2
'y':center.y + decoration.height/2 'y':center.y + decoration.height/2
} }
for cluster, range of decoration.clusters for cluster, range of decoration.clusters
for i in _.range(_.random(range[0], range[1])) for i in _.range(_.random(range[0], range[1]))