ld31-space-diggers/src/tiles/tilelayer.coffee

12 lines
327 B
CoffeeScript
Raw Normal View History

2014-12-06 21:36:19 +01:00
class Tilelayer
2014-12-06 17:17:30 +01:00
constructor: (options)->
2014-12-06 12:37:57 +01:00
{@type, @depth, @amount} = options
2014-12-06 14:52:03 +01:00
@randomFactor = getRandomInt 0, 4
2014-12-06 15:09:56 +01:00
@sprite = [@randomFactor*8, @depth*8, 8, 8]
2014-12-07 17:04:40 +01:00
@spritedetail = [0, @depth*16, 16, 16]
2014-12-07 00:15:16 +01:00
@hudSprite = [@randomFactor*8, @depth*8, 4, 4]
2014-12-06 17:17:30 +01:00
collect: ->
return false if @amount == 0
@amount -= 1