Working on tiles

This commit is contained in:
Ruben Müller 2014-12-06 20:51:21 +01:00
parent 471b8da421
commit 6134c64514
2 changed files with 11 additions and 2 deletions

View file

@ -15,14 +15,19 @@ class Tile extends BaseEntity
@currentLayer = 0
@isActive = false
died: false
click: (button)->
if button == "left"
if button == "left" and !@died
if @layers[@currentLayer].collect()
name = app.layerIndexToName(@currentLayer)
app.game.resources[name] += 1
else
@currentLayer += 1
if @currentLayer > app.game.resources.length
@died = true
tick: ->
@currentMiner.tick @

View file

@ -71,7 +71,11 @@ app.game =
resources:
stardust: 0
dirt: 0
bedrock: 0
lubinit: 0
oxodum: 0
lubinit: 0
darkana: 0
bio: 0
notch: 0
lava: 0