From 4acbe34b3554fb9be5e61cfce9b1f6b72694adbe Mon Sep 17 00:00:00 2001 From: Aaron Mueller Date: Sat, 6 Dec 2014 21:47:58 +0100 Subject: [PATCH] Add bars only on mining tiles --- src/tiles/tile.coffee | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/tiles/tile.coffee b/src/tiles/tile.coffee index ce9a8f5..98a0532 100644 --- a/src/tiles/tile.coffee +++ b/src/tiles/tile.coffee @@ -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)