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,12 +57,6 @@ class Tile
if @currentMiner if @currentMiner
app.layer.drawRegion app.images.entities, [16, 0, 8, 8], x*8, y*8 app.layer.drawRegion app.images.entities, [16, 0, 8, 8], x*8, y*8
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. # Draw the status indicator.
numPercent = Math.floor((tileLayer.amount*6)/app.game.maxTileAmount) numPercent = Math.floor((tileLayer.amount*6)/app.game.maxTileAmount)
for i in [0..numPercent] for i in [0..numPercent]
@ -70,3 +64,10 @@ class Tile
color = ["#f00", "#f00", "#f80", "#ff0", "#0f0", "#0f0"][numPercent] if i == numPercent color = ["#f00", "#f00", "#f80", "#ff0", "#0f0", "#0f0"][numPercent] if i == numPercent
app.layer.setPixel(color, x*8+1+i, y*8+6) 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