works
This commit is contained in:
parent
59d5e4c50e
commit
2a9deedee7
2 changed files with 8 additions and 10 deletions
|
@ -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)
|
||||
resTypes = (k for own k of app.game.resources)
|
||||
|
||||
@currentLayer = getRandomInt 0, 4
|
||||
@layers = (new Tilelayer(type: restype) for restype in resTypes)
|
||||
@currentLayer = getRandomInt 0, resTypes.length-1
|
||||
|
||||
tick: (delta) ->
|
||||
# TODO: digging deeper?
|
||||
|
||||
render: (x, y)->
|
||||
#tile = @layers[@currentLayer]
|
||||
#tile.render(app.layer, x, y)
|
||||
tile = @layers[@currentLayer]
|
||||
tile.render(app.layer, x, y)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
app.game.hud =
|
||||
render: ->
|
||||
for layer in [""]
|
||||
app.layer
|
||||
.fillStyle "#f00"
|
||||
.fillRect 0, 0, 8, 8
|
||||
|
|
Loading…
Reference in a new issue