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) ->
|
constructor: (options) ->
|
||||||
super options
|
super options
|
||||||
|
|
||||||
#@layers = (new Tilelayer(type: restype) for restype, amount in app.game.resources)
|
resTypes = (k for own k of app.game.resources)
|
||||||
for restype, amount in app.game.resources
|
|
||||||
console.log(restype, amount)
|
@layers = (new Tilelayer(type: restype) for restype in resTypes)
|
||||||
|
@currentLayer = getRandomInt 0, resTypes.length-1
|
||||||
@currentLayer = getRandomInt 0, 4
|
|
||||||
|
|
||||||
tick: (delta) ->
|
tick: (delta) ->
|
||||||
# TODO: digging deeper?
|
# TODO: digging deeper?
|
||||||
|
|
||||||
render: (x, y)->
|
render: (x, y)->
|
||||||
#tile = @layers[@currentLayer]
|
tile = @layers[@currentLayer]
|
||||||
#tile.render(app.layer, x, y)
|
tile.render(app.layer, x, y)
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
app.game.hud =
|
app.game.hud =
|
||||||
render: ->
|
render: ->
|
||||||
for layer in [""]
|
|
||||||
app.layer
|
app.layer
|
||||||
.fillStyle "#f00"
|
.fillStyle "#f00"
|
||||||
.fillRect 0, 0, 8, 8
|
.fillRect 0, 0, 8, 8
|
||||||
|
|
Loading…
Reference in a new issue