tiles ...

This commit is contained in:
Aaron Mueller 2014-12-06 13:14:15 +01:00
parent d41ff29aa0
commit 22e61f4e13
3 changed files with 9 additions and 13 deletions

View file

@ -1,16 +1,8 @@
class Tile extends BaseEntity class Tile extends BaseEntity
constructor: (options) -> constructor: (options) ->
super options super options
@seed = getRandomInt 0, 4 @layers = (new Tilelayer(type: restype) for restype, amount in app.game.resources)
@layers = [
new Tilelayer type: 'grass'
new Tilelayer type: 'mud'
new Tilelayer type: 'gravel'
new Tilelayer type: 'stone'
new Tilelayer type: 'gold'
]
@currentLayer = getRandomInt 0, 4 @currentLayer = getRandomInt 0, 4

View file

@ -13,5 +13,8 @@ app.game =
map: [] map: []
resources: resources:
ore:60 stardust: 0
stone: 100 bedrock: 0
lubinit: 0
oxodum: 0
notch: 0

View file

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