mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 05:53:39 -04:00
Spectate mode starts paused until loading is done, and starts at time 1, so there is less stuttering during playback.
This commit is contained in:
parent
98b0bcfc75
commit
89c644e084
1 changed files with 3 additions and 1 deletions
|
@ -158,7 +158,8 @@ module.exports = class SpectateLevelView extends RootView
|
|||
# Don't remove it; we want its decoration around on large screens.
|
||||
#@removeSubView @loadingView
|
||||
#@loadingView = null
|
||||
Backbone.Mediator.publish 'level:set-playing', playing: true
|
||||
Backbone.Mediator.publish 'level:set-playing', playing: false
|
||||
Backbone.Mediator.publish 'level:set-time', time: 1 # Helps to have perhaps built a few Thangs and gotten a good list of spritesheets we need to render for our initial paused frame
|
||||
|
||||
onSupermodelLoadedOne: =>
|
||||
@modelsLoaded ?= 0
|
||||
|
@ -256,6 +257,7 @@ module.exports = class SpectateLevelView extends RootView
|
|||
startFrame = @lastWorldFramesLoaded ? 0
|
||||
if @world.frames.length is @world.totalFrames # Finished loading
|
||||
@lastWorldFramesLoaded = 0
|
||||
Backbone.Mediator.publish 'level:set-playing', playing: true # Since we paused at first, now we autostart playback.
|
||||
else
|
||||
@lastWorldFramesLoaded = @world.frames.length
|
||||
for [spriteName, message] in @world.thangDialogueSounds startFrame
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue