Pimpt the progress bar
This commit is contained in:
parent
15d6f375cd
commit
3daf7f0edf
1 changed files with 6 additions and 13 deletions
|
@ -16,7 +16,6 @@ class Tile extends BaseEntity
|
||||||
@isActive = false
|
@isActive = false
|
||||||
|
|
||||||
click: (button)->
|
click: (button)->
|
||||||
#@isSelected = true
|
|
||||||
if button == "left"
|
if button == "left"
|
||||||
if @layers[@currentLayer].collect()
|
if @layers[@currentLayer].collect()
|
||||||
name = app.layerIndexToName(@currentLayer)
|
name = app.layerIndexToName(@currentLayer)
|
||||||
|
@ -30,22 +29,16 @@ class Tile extends BaseEntity
|
||||||
moveOut: ->
|
moveOut: ->
|
||||||
@isActive = false
|
@isActive = false
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
#if @isSelected
|
|
||||||
# app.layer.drawImage app.images.selected, x*8, y*8
|
|
||||||
if @isActive
|
if @isActive
|
||||||
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.
|
||||||
for i in [0..5]
|
numPercent = Math.ceil((tileLayer.amount*6)/app.game.maxTileAmount)
|
||||||
color = "#0a0"
|
for i in [0..numPercent]
|
||||||
color = "#0f0" if i == 5
|
color = ["#333", "#a00", "#f60", "#aa0", "#0a0", "#0a0"][numPercent]
|
||||||
|
color = ["#000", "#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)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue