mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-30 14:51:13 -04:00
Set up the goal manager to use goals from the new level goals property, rather than from scripts. Backward-compatible for now.
This commit is contained in:
parent
f3489a6c2f
commit
8176e2258f
3 changed files with 4 additions and 3 deletions
app
|
@ -64,7 +64,7 @@ self.transferableSupported = transferableSupported = ->
|
|||
if args.level
|
||||
self.world.loadFromLevel args.level, true
|
||||
self.goalManager = new GoalManager self.world
|
||||
self.goalManager.setGoals args.goals
|
||||
self.goalManager.setGoals args.level?.goals or args.goals
|
||||
self.goalManager.setCode args.userCodeMap
|
||||
self.goalManager.worldGenerationWillBegin()
|
||||
self.world.setGoalManager self.goalManager
|
||||
|
|
|
@ -15,7 +15,7 @@ module.exports = class GoalManager extends CocoClass
|
|||
|
||||
nextGoalID: 0
|
||||
|
||||
constructor: (@world) ->
|
||||
constructor: (@world, @initialGoals) ->
|
||||
super()
|
||||
@init()
|
||||
|
||||
|
@ -25,6 +25,7 @@ module.exports = class GoalManager extends CocoClass
|
|||
@userCodeMap = {} # @userCodeMap.thangID.methodName.aether.raw = codeString
|
||||
@thangTeams = {}
|
||||
@initThangTeams()
|
||||
@addGoal goal for goal in @initialGoals if @initialGoals
|
||||
|
||||
initThangTeams: ->
|
||||
return unless @world
|
||||
|
|
|
@ -327,7 +327,7 @@ module.exports = class PlayLevelView extends View
|
|||
@surface.camera.zoomTo({x:0, y:0}, 0.1, 0)
|
||||
|
||||
initGoalManager: ->
|
||||
@goalManager = new GoalManager(@world)
|
||||
@goalManager = new GoalManager(@world, @level.get('goals'))
|
||||
@god.goalManager = @goalManager
|
||||
|
||||
initScriptManager: ->
|
||||
|
|
Loading…
Add table
Reference in a new issue