mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-13 22:49:51 -04:00
Lowered Surface framerate in the level editor, since ain't nobody got CPU time for 'dat.
This commit is contained in:
parent
9a9bc20c68
commit
71ebe7a0aa
2 changed files with 5 additions and 4 deletions
|
@ -38,7 +38,6 @@ module.exports = Surface = class Surface extends CocoClass
|
|||
worldLoaded: false
|
||||
scrubbing: false
|
||||
debug: false
|
||||
frameRate: 60
|
||||
|
||||
defaults:
|
||||
wizards: true
|
||||
|
@ -49,6 +48,7 @@ module.exports = Surface = class Surface extends CocoClass
|
|||
coords: true
|
||||
playJingle: false
|
||||
showInvisible: false
|
||||
frameRate: 60
|
||||
|
||||
subscriptions:
|
||||
'level-disable-controls': 'onDisableControls'
|
||||
|
@ -374,7 +374,7 @@ module.exports = Surface = class Surface extends CocoClass
|
|||
@stage.addEventListener 'stagemousedown', @onMouseDown
|
||||
@canvas.on 'mousewheel', @onMouseWheel
|
||||
@hookUpChooseControls() if @options.choosing
|
||||
createjs.Ticker.setFPS @frameRate
|
||||
createjs.Ticker.setFPS @options.frameRate
|
||||
|
||||
showLevel: ->
|
||||
return if @dead
|
||||
|
@ -500,7 +500,7 @@ module.exports = Surface = class Surface extends CocoClass
|
|||
@trailmaster.tick() if @trailmaster
|
||||
# Skip some frame updates unless we're playing and not at end (or we haven't drawn much yet)
|
||||
frameAdvanced = (@playing and @currentFrame < @world.totalFrames) or @totalFramesDrawn < 2
|
||||
@currentFrame += @world.frameRate / @frameRate if frameAdvanced
|
||||
@currentFrame += @world.frameRate / @options.frameRate if frameAdvanced
|
||||
newWorldFrame = Math.floor @currentFrame
|
||||
worldFrameAdvanced = newWorldFrame isnt oldWorldFrame
|
||||
if worldFrameAdvanced
|
||||
|
@ -517,7 +517,7 @@ module.exports = Surface = class Surface extends CocoClass
|
|||
@drawCurrentFrame e
|
||||
@onFrameChanged()
|
||||
@updatePaths() if (@totalFramesDrawn % 4) is 0 or createjs.Ticker.getMeasuredFPS() > createjs.Ticker.getFPS() - 5
|
||||
Backbone.Mediator.publish('surface:ticked', {dt: 1 / @frameRate})
|
||||
Backbone.Mediator.publish('surface:ticked', {dt: 1 / @options.frameRate})
|
||||
mib = @stage.mouseInBounds
|
||||
if @mouseInBounds isnt mib
|
||||
Backbone.Mediator.publish('surface:mouse-' + (if mib then "over" else "out"), {})
|
||||
|
|
|
@ -140,6 +140,7 @@ module.exports = class ThangsTabView extends View
|
|||
navigateToSelection: false
|
||||
thangTypes: @supermodel.getModels(ThangType)
|
||||
showInvisible: true
|
||||
frameRate: 15
|
||||
}
|
||||
@surface.playing = false
|
||||
@surface.setWorld @world
|
||||
|
|
Loading…
Reference in a new issue