Silo capacity
This commit is contained in:
parent
834239d184
commit
8236c2c887
2 changed files with 10 additions and 9 deletions
|
@ -50,11 +50,11 @@ app.game =
|
||||||
tile.tick() for tile in app.game.map
|
tile.tick() for tile in app.game.map
|
||||||
|
|
||||||
createMiner: ->
|
createMiner: ->
|
||||||
if @currentSelectedTile and @checkResource 'lubinit', 30, true
|
if @currentSelectedTile and @checkResource 'stardust', 1, true
|
||||||
@currentSelectedTile.entity = new Miner
|
@currentSelectedTile.entity = new Miner
|
||||||
|
|
||||||
createSilo: ->
|
createSilo: ->
|
||||||
if @currentSelectedTile and @checkResource 'oxodum', 20, true
|
if @currentSelectedTile and @checkResource 'stardust', 1, true
|
||||||
@currentSelectedTile.entity = new Silo
|
@currentSelectedTile.entity = new Silo
|
||||||
|
|
||||||
checkResource: (type, amount, drain = false) ->
|
checkResource: (type, amount, drain = false) ->
|
||||||
|
|
|
@ -14,6 +14,7 @@ class Tile
|
||||||
|
|
||||||
click: (button)->
|
click: (button)->
|
||||||
if button == "left"
|
if button == "left"
|
||||||
|
if (app.game.availableSiloStorage() - app.game.usedSiloStorage()) > 0
|
||||||
if @layers[@currentLayer].collect()
|
if @layers[@currentLayer].collect()
|
||||||
name = app.layerIndexToName(@currentLayer)
|
name = app.layerIndexToName(@currentLayer)
|
||||||
app.game.resources[name] += 1
|
app.game.resources[name] += 1
|
||||||
|
|
Loading…
Reference in a new issue