mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Merge branch 'master' of https://github.com/codecombat/codecombat
This commit is contained in:
commit
d9f4594c9f
4 changed files with 7 additions and 3 deletions
|
@ -33,7 +33,7 @@ class Media
|
||||||
|
|
||||||
class AudioPlayer extends CocoClass
|
class AudioPlayer extends CocoClass
|
||||||
subscriptions:
|
subscriptions:
|
||||||
'play-sound': (e) -> @playInterfaceSound e.trigger
|
'play-sound': (e) -> @playInterfaceSound e.trigger, e.volume
|
||||||
|
|
||||||
constructor: () ->
|
constructor: () ->
|
||||||
super()
|
super()
|
||||||
|
|
|
@ -13,6 +13,7 @@ module.exports = class God
|
||||||
@ids[@lastID]
|
@ids[@lastID]
|
||||||
|
|
||||||
maxAngels: 2 # how many concurrent web workers to use; if set past 8, make up more names
|
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
|
worldWaiting: false # whether we're waiting for a worker to free up and run the world
|
||||||
constructor: ->
|
constructor: ->
|
||||||
@id = God.nextID()
|
@id = God.nextID()
|
||||||
|
@ -30,8 +31,10 @@ module.exports = class God
|
||||||
fillWorkerPool: =>
|
fillWorkerPool: =>
|
||||||
return unless Worker
|
return unless Worker
|
||||||
@workerPool ?= []
|
@workerPool ?= []
|
||||||
while @workerPool.length < @maxAngels
|
if @workerPool.length < @maxWorkerPoolSize
|
||||||
@workerPool.push @createWorker()
|
@workerPool.push @createWorker()
|
||||||
|
if @workerPool.length < @maxWorkerPoolSize
|
||||||
|
@fillWorkerPool()
|
||||||
|
|
||||||
getWorker: ->
|
getWorker: ->
|
||||||
@fillWorkerPool()
|
@fillWorkerPool()
|
||||||
|
|
|
@ -54,6 +54,7 @@ module.exports = class CastButtonView extends View
|
||||||
|
|
||||||
onCastSpells: (e) ->
|
onCastSpells: (e) ->
|
||||||
@casting = true
|
@casting = true
|
||||||
|
Backbone.Mediator.publish 'play-sound', trigger: 'cast', volume: 0.25
|
||||||
@updateCastButton()
|
@updateCastButton()
|
||||||
|
|
||||||
onWorldLoadProgressChanged: (e) ->
|
onWorldLoadProgressChanged: (e) ->
|
||||||
|
|
2
vendor/scripts/Box2dWeb-2.1.a.3.js
vendored
2
vendor/scripts/Box2dWeb-2.1.a.3.js
vendored
|
@ -3705,7 +3705,7 @@ Box2D.postDefs = [];
|
||||||
Box2D.Common.b2Settings.b2_velocityThreshold = 1.0;
|
Box2D.Common.b2Settings.b2_velocityThreshold = 1.0;
|
||||||
Box2D.Common.b2Settings.b2_maxLinearCorrection = 0.2;
|
Box2D.Common.b2Settings.b2_maxLinearCorrection = 0.2;
|
||||||
Box2D.Common.b2Settings.b2_maxAngularCorrection = 8.0 / 180.0 * b2Settings.b2_pi;
|
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_maxTranslationSquared = b2Settings.b2_maxTranslation * b2Settings.b2_maxTranslation;
|
||||||
Box2D.Common.b2Settings.b2_maxRotation = 0.5 * b2Settings.b2_pi;
|
Box2D.Common.b2Settings.b2_maxRotation = 0.5 * b2Settings.b2_pi;
|
||||||
Box2D.Common.b2Settings.b2_maxRotationSquared = b2Settings.b2_maxRotation * b2Settings.b2_maxRotation;
|
Box2D.Common.b2Settings.b2_maxRotationSquared = b2Settings.b2_maxRotation * b2Settings.b2_maxRotation;
|
||||||
|
|
Loading…
Reference in a new issue