Fix Camera bounds by adding ScriptManager
This commit is contained in:
parent
4a51045a41
commit
b982f3fd52
1 changed files with 5 additions and 0 deletions
|
@ -4,6 +4,7 @@ GameUIState = require 'models/GameUIState'
|
||||||
God = require 'lib/God'
|
God = require 'lib/God'
|
||||||
LevelLoader = require 'lib/LevelLoader'
|
LevelLoader = require 'lib/LevelLoader'
|
||||||
GoalManager = require 'lib/world/GoalManager'
|
GoalManager = require 'lib/world/GoalManager'
|
||||||
|
ScriptManager = require 'lib/scripts/ScriptManager'
|
||||||
Surface = require 'lib/surface/Surface'
|
Surface = require 'lib/surface/Surface'
|
||||||
ThangType = require 'models/ThangType'
|
ThangType = require 'models/ThangType'
|
||||||
Level = require 'models/Level'
|
Level = require 'models/Level'
|
||||||
|
@ -46,6 +47,9 @@ module.exports = class PlayGameDevLevelView extends RootView
|
||||||
@god.angelsShare.firstWorld = false # HACK
|
@god.angelsShare.firstWorld = false # HACK
|
||||||
me.team = TEAM
|
me.team = TEAM
|
||||||
@session.set 'team', TEAM
|
@session.set 'team', TEAM
|
||||||
|
@scriptManager = new ScriptManager({
|
||||||
|
scripts: @world.scripts or [], view: @, @session, levelID: @level.get('slug')})
|
||||||
|
@scriptManager.loadFromSession() # Should we? TODO: Figure out how scripts work for game dev levels
|
||||||
@supermodel.finishLoading()
|
@supermodel.finishLoading()
|
||||||
|
|
||||||
.then (supermodel) =>
|
.then (supermodel) =>
|
||||||
|
@ -63,6 +67,7 @@ module.exports = class PlayGameDevLevelView extends RootView
|
||||||
@surface.camera.setBounds(bounds)
|
@surface.camera.setBounds(bounds)
|
||||||
@surface.camera.zoomTo({x: 0, y: 0}, 0.1, 0)
|
@surface.camera.zoomTo({x: 0, y: 0}, 0.1, 0)
|
||||||
@surface.setWorld(@world)
|
@surface.setWorld(@world)
|
||||||
|
@scriptManager.initializeCamera()
|
||||||
@renderSelectors '#info-col'
|
@renderSelectors '#info-col'
|
||||||
@spells = @session.generateSpellsObject()
|
@spells = @session.generateSpellsObject()
|
||||||
@state.set('loading', false)
|
@state.set('loading', false)
|
||||||
|
|
Reference in a new issue