Add bars only on mining tiles

This commit is contained in:
Aaron Mueller 2014-12-06 21:47:58 +01:00
parent c4ba7c582b
commit 4acbe34b35

View file

@ -57,16 +57,17 @@ class Tile
if @currentMiner
app.layer.drawRegion app.images.entities, [16, 0, 8, 8], x*8, y*8
# 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)
if @isSelected
app.layer.drawImage app.images.selected, x*8, y*8
if @isActive
app.layer.drawImage app.images.active, x*8, y*8
# 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)