From ca8d5c1f3bcd12052ffe882d8f4066b76436bdf3 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Tue, 6 May 2014 11:02:53 -0700 Subject: [PATCH] Stop bobbing and more marks when world ended. --- app/lib/surface/CocoSprite.coffee | 6 +++++- app/lib/surface/SpriteBoss.coffee | 4 ++-- app/views/play/spectate_view.coffee | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/lib/surface/CocoSprite.coffee b/app/lib/surface/CocoSprite.coffee index 55a1982e4..225c6b308 100644 --- a/app/lib/surface/CocoSprite.coffee +++ b/app/lib/surface/CocoSprite.coffee @@ -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 diff --git a/app/lib/surface/SpriteBoss.coffee b/app/lib/surface/SpriteBoss.coffee index 03e05e0c3..1c7916817 100644 --- a/app/lib/surface/SpriteBoss.coffee +++ b/app/lib/surface/SpriteBoss.coffee @@ -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() diff --git a/app/views/play/spectate_view.coffee b/app/views/play/spectate_view.coffee index 8c72f742b..97bcc0a02 100644 --- a/app/views/play/spectate_view.coffee +++ b/app/views/play/spectate_view.coffee @@ -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'