mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
Stop bobbing and more marks when world ended.
This commit is contained in:
parent
2e6bec5454
commit
ca8d5c1f3b
3 changed files with 8 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue