You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
296 B

getRandomInt = (min, max) ->
Math.floor(Math.random() * (max - min + 1)) + min;
allResourceTypes = ->
(k for own k of app.game.resources)
posToTile = (x, y)->
app.game.map[xyToPos(x, y)]
posToXY = (pos)->
y = Math.floor(pos/20)
x = pos-(y*20)
[x, y]
xyToPos = (x, y)->
y*20 + x