11 lines
305 B
CoffeeScript
11 lines
305 B
CoffeeScript
class Tilelayer extends BaseEntity
|
|
constructor: (options) ->
|
|
{@type, @depth, @amount} = options
|
|
@randomFactor = getRandomInt 0, 4
|
|
@sprite = [@randomFactor*8, @depth*8, @randomFactor*8+8, @depth*8+8]
|
|
|
|
render: (layer, x, y) ->
|
|
layer.drawRegion app.images.layers, @sprite, x*8, y*8
|
|
|
|
|