Merge branch 'master' into production

This commit is contained in:
Nick Winter 2014-05-20 12:32:47 -07:00
commit 161c81772c
3 changed files with 11 additions and 2 deletions

View file

@ -758,7 +758,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
endFunc = =>
@lastTween = null
@imageObject.gotoAndPlay(endAnimation)
@imageObject.gotoAndPlay(endAnimation) unless @stillLoading
@shadow.action = 'idle'
@update true
@possessed = false

View file

@ -281,6 +281,7 @@ module.exports = Surface = class Surface extends CocoClass
onSetPlaying: (e) ->
@playing = (e ? {}).playing ? true
@setPlayingCalled = true
if @playing and @currentFrame >= (@world.totalFrames - 5)
@currentFrame = 0
if @fastForwarding and not @playing
@ -352,6 +353,7 @@ module.exports = Surface = class Surface extends CocoClass
@casting = true
@wasPlayingWhenCastingBegan = @playing
Backbone.Mediator.publish 'level-set-playing', { playing: false }
@setPlayingCalled = false # don't overwrite playing settings if they changed by, say, scripts
if @coordinateDisplay?
@surfaceTextLayer.removeChild @coordinateDisplay
@ -370,7 +372,7 @@ module.exports = Surface = class Surface extends CocoClass
# This has a tendency to break scripts that are waiting for playback to change when the level is loaded
# so only run it after the first world is created.
Backbone.Mediator.publish 'level-set-playing', { playing: @wasPlayingWhenCastingBegan } unless event.firstWorld
Backbone.Mediator.publish 'level-set-playing', { playing: @wasPlayingWhenCastingBegan } unless event.firstWorld or @setPlayingCalled
fastForwardTo = null
if @playing

View file

@ -47,6 +47,13 @@ module.exports = class WizardSprite extends IndieSprite
thang.pos.z += thang.bobHeight
thang
finishSetup: ->
@updateBaseScale()
@scaleFactor = @thang.scaleFactor if @thang?.scaleFactor
@updateScale()
@updateRotation()
# Don't call general update() because Thang isn't built yet
onPlayerStatesChanged: (e) ->
for playerID, state of e.states
continue unless playerID is @thang.id