space calculation
This commit is contained in:
parent
c6619f1247
commit
fe496a24d4
4 changed files with 17 additions and 0 deletions
|
@ -6,4 +6,6 @@ class Base
|
|||
|
||||
isMoveable: ->
|
||||
false
|
||||
|
||||
spaceProvided: 50
|
||||
|
||||
|
|
|
@ -7,3 +7,5 @@ class Miner
|
|||
|
||||
isMoveable: ->
|
||||
true
|
||||
|
||||
spaceProvided: 5
|
||||
|
|
|
@ -17,3 +17,5 @@ class Silo
|
|||
else
|
||||
@frame += 1
|
||||
|
||||
spaceProvided: 150
|
||||
|
||||
|
|
|
@ -71,6 +71,17 @@ app.game =
|
|||
miners: []
|
||||
maxTileAmount: 15
|
||||
|
||||
availableSiloStorage: ->
|
||||
space = 0
|
||||
for tile in app.game.map
|
||||
space += tile.spaceProvided
|
||||
space
|
||||
|
||||
usedSiloStorage: ->
|
||||
space = 0
|
||||
space += amount for resource, amount of @resources
|
||||
space
|
||||
|
||||
resources:
|
||||
stardust: 0
|
||||
dirt: 0
|
||||
|
|
Loading…
Reference in a new issue