Stop bobbing and more marks when world ended.

This commit is contained in:
Nick Winter 2014-05-06 11:02:53 -07:00
parent 2e6bec5454
commit ca8d5c1f3b
3 changed files with 8 additions and 4 deletions

View file

@ -168,10 +168,12 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
stop: ->
@imageObject?.stop?()
mark.stop() for name, mark of @marks
@stopped = true
play: ->
@imageObject?.play?()
mark.play() for name, mark of @marks
@stopped = false
update: (frameChanged) ->
# Gets the sprite to reflect what the current state of the thangs and surface are
@ -222,7 +224,8 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
getBobOffset: ->
return 0 unless @thang.bobHeight
@thang.bobHeight * (1 + Math.sin(@age * Math.PI / @thang.bobTime))
return @lastBobOffset if @stopped
return @lastBobOffset = @thang.bobHeight * (1 + Math.sin(@age * Math.PI / @thang.bobTime))
getWorldPosition: ->
p1 = if @possessed then @shadow.pos else @thang.pos
@ -495,6 +498,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
updateEffectMarks: ->
return if _.isEqual @thang.effectNames, @previousEffectNames
return if @stopped
for effect in @thang.effectNames
mark = @addMark effect, @options.floatingLayer, effect
mark.statusEffect = true

View file

@ -221,12 +221,12 @@ module.exports = class SpriteBoss extends CocoClass
onCastSpells: -> @stop()
play: ->
sprite.imageObject.play() for sprite in @spriteArray
sprite.play() for sprite in @spriteArray
@selectionMark?.play()
@targetMark?.play()
stop: ->
sprite.imageObject.stop() for sprite in @spriteArray
sprite.stop() for sprite in @spriteArray
@selectionMark?.stop()
@targetMark?.stop()

View file

@ -8,7 +8,7 @@ World = require 'lib/world/world'
# tools
Surface = require 'lib/surface/Surface'
God = require 'lib/Buddha' # 'lib/God'
God = require 'lib/God' # 'lib/Buddha'
GoalManager = require 'lib/world/GoalManager'
ScriptManager = require 'lib/scripts/ScriptManager'
LevelLoader = require 'lib/LevelLoader'