This commit is contained in:
Scott Erickson 2014-02-11 15:39:02 -08:00
commit d9f4594c9f
4 changed files with 7 additions and 3 deletions

View file

@ -33,7 +33,7 @@ class Media
class AudioPlayer extends CocoClass
subscriptions:
'play-sound': (e) -> @playInterfaceSound e.trigger
'play-sound': (e) -> @playInterfaceSound e.trigger, e.volume
constructor: () ->
super()

View file

@ -13,6 +13,7 @@ module.exports = class God
@ids[@lastID]
maxAngels: 2 # how many concurrent web workers to use; if set past 8, make up more names
maxWorkerPoolSize: 2 # ~20MB per idle worker
worldWaiting: false # whether we're waiting for a worker to free up and run the world
constructor: ->
@id = God.nextID()
@ -30,8 +31,10 @@ module.exports = class God
fillWorkerPool: =>
return unless Worker
@workerPool ?= []
while @workerPool.length < @maxAngels
if @workerPool.length < @maxWorkerPoolSize
@workerPool.push @createWorker()
if @workerPool.length < @maxWorkerPoolSize
@fillWorkerPool()
getWorker: ->
@fillWorkerPool()

View file

@ -54,6 +54,7 @@ module.exports = class CastButtonView extends View
onCastSpells: (e) ->
@casting = true
Backbone.Mediator.publish 'play-sound', trigger: 'cast', volume: 0.25
@updateCastButton()
onWorldLoadProgressChanged: (e) ->

View file

@ -3705,7 +3705,7 @@ Box2D.postDefs = [];
Box2D.Common.b2Settings.b2_velocityThreshold = 1.0;
Box2D.Common.b2Settings.b2_maxLinearCorrection = 0.2;
Box2D.Common.b2Settings.b2_maxAngularCorrection = 8.0 / 180.0 * b2Settings.b2_pi;
Box2D.Common.b2Settings.b2_maxTranslation = 2.0;
Box2D.Common.b2Settings.b2_maxTranslation = 20.0;
Box2D.Common.b2Settings.b2_maxTranslationSquared = b2Settings.b2_maxTranslation * b2Settings.b2_maxTranslation;
Box2D.Common.b2Settings.b2_maxRotation = 0.5 * b2Settings.b2_pi;
Box2D.Common.b2Settings.b2_maxRotationSquared = b2Settings.b2_maxRotation * b2Settings.b2_maxRotation;