mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 08:50:58 -05:00
Got lanks to update healthbars when the floating layer spritesheet is recreated.
This commit is contained in:
parent
716f8864f1
commit
09087428b9
1 changed files with 3 additions and 0 deletions
|
@ -491,6 +491,7 @@ module.exports = Lank = class Lank extends CocoClass
|
|||
bar = createProgressBar(healthColor)
|
||||
@options.floatingLayer.addCustomGraphic(key, bar, bar.bounds)
|
||||
|
||||
hadHealthBar = @healthBar
|
||||
@healthBar = new createjs.Sprite(@options.floatingLayer.spriteSheet)
|
||||
@healthBar.gotoAndStop(key)
|
||||
offset = @getOffset 'aboveHead'
|
||||
|
@ -499,6 +500,8 @@ module.exports = Lank = class Lank extends CocoClass
|
|||
@options.floatingLayer.addChild @healthBar
|
||||
@updateHealthBar()
|
||||
@lastHealth = null
|
||||
if not hadHealthBar
|
||||
@listenTo @options.floatingLayer, 'new-spritesheet', @addHealthBar
|
||||
|
||||
getActionProp: (prop, subProp, def=null) ->
|
||||
# Get a property or sub-property from an action, falling back to ThangType
|
||||
|
|
Loading…
Reference in a new issue