mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 10:06:08 -05:00
Fixed some bugs with sprite sound loading and playback.
This commit is contained in:
parent
65aae86dcc
commit
ca6ea474bf
2 changed files with 12 additions and 10 deletions
|
@ -80,6 +80,8 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
||||||
@listenToOnce(@thangType, 'sync', @setupSprite)
|
@listenToOnce(@thangType, 'sync', @setupSprite)
|
||||||
|
|
||||||
setupSprite: ->
|
setupSprite: ->
|
||||||
|
for trigger, sounds of @thangType.get('soundTriggers') or {} when trigger isnt 'say'
|
||||||
|
AudioPlayer.preloadSoundReference sound for sound in sounds
|
||||||
@stillLoading = false
|
@stillLoading = false
|
||||||
if @thangType.get('raster')
|
if @thangType.get('raster')
|
||||||
@isRaster = true
|
@isRaster = true
|
||||||
|
|
|
@ -272,7 +272,7 @@ module.exports = class SpriteBoss extends CocoClass
|
||||||
@selectedSprite?.selected = false
|
@selectedSprite?.selected = false
|
||||||
sprite?.selected = true
|
sprite?.selected = true
|
||||||
@selectedSprite = sprite
|
@selectedSprite = sprite
|
||||||
alive = sprite?.thang.health > 0
|
alive = not (sprite?.thang.health < 0)
|
||||||
|
|
||||||
Backbone.Mediator.publish 'surface:sprite-selected',
|
Backbone.Mediator.publish 'surface:sprite-selected',
|
||||||
thang: if sprite then sprite.thang else null
|
thang: if sprite then sprite.thang else null
|
||||||
|
|
Loading…
Reference in a new issue