Merge branch 'master' of https://github.com/arg-games/ld31
Conflicts: src/entities/tile.coffee
This commit is contained in:
commit
06d95fc11a
1 changed files with 6 additions and 5 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue