ld31-space-diggers/src/tools.coffee
2014-12-06 23:17:58 +01:00

9 lines
232 B
CoffeeScript

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