Merge branch 'master' into production

This commit is contained in:
Nick Winter 2014-10-20 17:53:16 -07:00
commit fd83fd5289
2 changed files with 9 additions and 1 deletions
app
assets/images/pages/game-menu
lib/world

Binary file not shown.

Before

(image error) Size: 54 KiB

After

(image error) Size: 55 KiB

View file

@ -63,7 +63,9 @@ module.exports = class GoalManager extends CocoClass
# gets these goals and code, and is told to be all ears during world gen
setGoals: (@goals) ->
setCode: (@userCodeMap) -> @updateCodeGoalStates()
worldGenerationWillBegin: -> @initGoalStates()
worldGenerationWillBegin: ->
@initGoalStates()
@checkForInitialUserCodeProblems()
# World generator feeds world events to the goal manager to keep track
submitWorldGenerationEvent: (channel, event, frameNumber) ->
@ -148,6 +150,12 @@ module.exports = class GoalManager extends CocoClass
@initGoalState(state, [_.keys(goal.linesOfCode ? {})], 'lines')
@goalStates[goal.id] = state
checkForInitialUserCodeProblems: ->
# There might have been some user code problems reported before the goal manager started listening.
for thang in @world.thangs when thang.isProgrammable
for message, problem of thang.publishedUserCodeProblems
@onUserCodeProblem {thang: thang, problem: problem}, 0
onThangDied: (e, frameNumber) ->
for goal in @goals ? []
@checkKillThangs(goal.id, goal.killThangs, e.thang, frameNumber) if goal.killThangs?