Conflicts:
	src/entities/tile.coffee
This commit is contained in:
Ruben Müller 2014-12-06 18:54:52 +01:00
commit 06d95fc11a

View file

@ -42,9 +42,6 @@ class Tile extends BaseEntity
detachMiner: -> detachMiner: ->
@currentMiner = null @currentMiner = null
tick: (delta) ->
# TODO: digging deeper?
render: (x, y)-> render: (x, y)->
tileLayer = @layers[@currentLayer] tileLayer = @layers[@currentLayer]
app.layer.drawRegion app.images.layers, tileLayer.sprite, x*8, y*8 app.layer.drawRegion app.images.layers, tileLayer.sprite, x*8, y*8
@ -59,5 +56,9 @@ class Tile extends BaseEntity
app.layer.drawImage app.images.active, x*8, y*8 app.layer.drawImage app.images.active, x*8, y*8
# Draw the status indicator. # Draw the status indicator.
numPercent = Math.floor((tileLayer.amount*6)/app.game.maxTileAmount)
for i in [0..numPercent]
color = ["#f00", "#a00", "#f60", "#aa0", "#0a0", "#0a0"][numPercent]
color = ["#f00", "#f00", "#f80", "#ff0", "#0f0", "#0f0"][numPercent] if i == numPercent
app.layer.setPixel(color, x*8+1+i, y*8+6)