This commit is contained in:
Aaron Mueller 2014-12-06 13:54:54 +01:00
parent 59d5e4c50e
commit 2a9deedee7
2 changed files with 8 additions and 10 deletions

View file

@ -2,15 +2,14 @@ class Tile extends BaseEntity
constructor: (options) ->
super options
#@layers = (new Tilelayer(type: restype) for restype, amount in app.game.resources)
for restype, amount in app.game.resources
console.log(restype, amount)
@currentLayer = getRandomInt 0, 4
resTypes = (k for own k of app.game.resources)
@layers = (new Tilelayer(type: restype) for restype in resTypes)
@currentLayer = getRandomInt 0, resTypes.length-1
tick: (delta) ->
# TODO: digging deeper?
# TODO: digging deeper?
render: (x, y)->
#tile = @layers[@currentLayer]
#tile.render(app.layer, x, y)
tile = @layers[@currentLayer]
tile.render(app.layer, x, y)

View file

@ -1,6 +1,5 @@
app.game.hud =
render: ->
for layer in [""]
app.layer
.fillStyle "#f00"
.fillRect 0, 0, 8, 8