ld31-space-diggers/src/entities/tilelayer.coffee
2014-12-06 12:57:25 +01:00

18 lines
440 B
CoffeeScript

class Tilelayer extends BaseEntity
constructor: (options) ->
{@type, @depth, @amount} = options
render: (layer, x, y)->
# TODO: Draw sprite
switch @type
when "grass" then color = "green"
when "mud" then color = "brown"
when "gravel" then color = "lightgrey"
when "stone" then color = "darkgrey"
when "gold" then color = "yellow"
layer.fillStyle color
.fillRect x*8, y*8, 8, 8