ld31-space-diggers/src/tools.coffee

10 lines
232 B
CoffeeScript
Raw Normal View History

2014-12-06 12:57:25 +01:00
getRandomInt = (min, max) ->
2014-12-06 23:17:58 +01:00
Math.floor(Math.random() * (max - min + 1)) + min;
2014-12-06 22:07:28 +01:00
allResourceTypes = ->
2014-12-06 23:17:58 +01:00
(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]