This commit is contained in:
Scott Erickson 2014-02-25 10:50:53 -08:00
commit f4084ba5cc
5 changed files with 9 additions and 13 deletions

View file

@ -87,6 +87,9 @@ module.exports = class LevelBus extends Bus
# LevelSession object. Either break this off into a separate class
# or have the LevelSession object listen for all these events itself.
setSpells: (spells) ->
@onSpellCreated spell: spell for spellKey, spell of spells
onSpellChanged: (e) ->
return unless @onPoint()
code = @session.get('code')
@ -102,6 +105,7 @@ module.exports = class LevelBus extends Bus
onSpellCreated: (e) ->
return unless @onPoint()
spellTeam = e.spell.team
@teamSpellMap ?= {}
@teamSpellMap[spellTeam] ?= []
unless e.spell.spellKey in @teamSpellMap[spellTeam]
@ -109,8 +113,7 @@ module.exports = class LevelBus extends Bus
@changedSessionProperties.teamSpells = true
@session.set({'teamSpells': @teamSpellMap})
@saveSession()
@onSpellChanged e # Save the new spell to the session, too.
onScriptStateChanged: (e) ->
return unless @onPoint()
@ -236,10 +239,3 @@ module.exports = class LevelBus extends Bus
destroy: ->
@session.off 'change:multiplayer', @onMultiplayerChanged, @
super()
setTeamSpellMap: (spellMap) ->
@teamSpellMap = spellMap
console.log @teamSpellMap
@changedSessionProperties.teamSpells = true
@session.set({'teamSpells': @teamSpellMap})
@saveSession()

View file

@ -22,6 +22,7 @@ module.exports = IndieSprite = class IndieSprite extends CocoSprite
thang.width = thang.height = thang.depth = 4
thang.pos = pos ? @defaultPos()
thang.pos.z = thang.depth / 2
thang.shape = 'ellipsoid'
thang.rotation = 0
thang.action = 'idle'
thang.setAction = (action) -> thang.action = action

View file

@ -7,7 +7,7 @@ block content
!{description}
if !me.get('anonymous')
a(href="http://www.youtube.com/watch?v=IFvfZiJGDsw&list=HL1392928835&feature=mh_lolz").intro-button.btn.btn-primary.btn-lg Watch the Video
//a(href="http://www.youtube.com/watch?v=IFvfZiJGDsw&list=HL1392928835&feature=mh_lolz").intro-button.btn.btn-primary.btn-lg Watch the Video
a(href="/play/level/ladder-tutorial").intro-button.btn.btn-primary.btn-lg Play the Tutorial

View file

@ -393,7 +393,7 @@ module.exports = class PlayLevelView extends View
register: ->
@bus = LevelBus.get(@levelID, @session.id)
@bus.setSession(@session)
@bus.setTeamSpellMap @tome.teamSpellMap
@bus.setSpells @tome.spells
@bus.connect() if @session.get('multiplayer')
onSessionWillSave: (e) ->

View file

@ -62,7 +62,6 @@
"sendwithus": "2.0.x",
"aws-sdk":"~2.0.0",
"bayesian-battle":"0.0.x",
"hiredis":"",
"redis": ""
},
"devDependencies": {
@ -70,7 +69,7 @@
"javascript-brunch": "> 1.0 < 1.8",
"coffee-script-brunch": "https://github.com/brunch/coffee-script-brunch/tarball/master",
"coffeelint-brunch": "> 1.0 < 1.8",
"sass-brunch": "1.7.0",
"sass-brunch": "~1.8.0",
"css-brunch": "> 1.0 < 1.8",
"jade-brunch": "> 1.0 < 1.8",
"uglify-js-brunch": "~1.7.4",