From 39c8f76a1396d609b4ca330ff8c8dfaaf64b66e6 Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 20 Apr 2015 15:31:25 +0200 Subject: [PATCH 01/68] repaired debug view (offsetting) --- app/Game/Client/View/Pixi/Layers/Debug.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/app/Game/Client/View/Pixi/Layers/Debug.js b/app/Game/Client/View/Pixi/Layers/Debug.js index c7ae643..c5b650e 100644 --- a/app/Game/Client/View/Pixi/Layers/Debug.js +++ b/app/Game/Client/View/Pixi/Layers/Debug.js @@ -16,12 +16,5 @@ function (Parent, PIXI) { Debug.prototype = Object.create(Parent.prototype); - Debug.prototype.render = function(centerPosition, zoom) { - Parent.prototype.render.call(this, centerPosition, zoom); - - this.container.x -= 300 * zoom; - this.container.y -= 200 * zoom; - }; - return new Debug(); }); \ No newline at end of file From 8f5ee0b2476b9b8e71c7e29de32d73d95d67ea8d Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 20 Apr 2015 15:58:41 +0200 Subject: [PATCH 02/68] rebuilt skateboard without joints --- app/Game/Core/GameObjects/Items/Skateboard.js | 133 +++++++++++++++--- app/Game/Core/Loader/Level.js | 4 +- 2 files changed, 118 insertions(+), 19 deletions(-) diff --git a/app/Game/Core/GameObjects/Items/Skateboard.js b/app/Game/Core/GameObjects/Items/Skateboard.js index e6124c9..ae4e00a 100755 --- a/app/Game/Core/GameObjects/Items/Skateboard.js +++ b/app/Game/Core/GameObjects/Items/Skateboard.js @@ -12,16 +12,114 @@ function (Parent, Box2D, Settings, Assert) { function Skateboard(physicsEngine, uid, options) { Parent.call(this, physicsEngine, uid, options); + } + + Skateboard.prototype = Object.create(Parent.prototype); + + Skateboard.prototype.createFixture = function () { + Assert.number(this.options.width, this.options.height); + Assert.number(this.options.weight); + + var deckShape = new Box2D.Collision.Shapes.b2PolygonShape(); + var w = this.options.width / Settings.RATIO; + var h = 2 / Settings.RATIO; + deckShape.SetAsOrientedBox(w / 2, h / 2, new Box2D.Common.Math.b2Vec2(0, -(4.5 / Settings.RATIO))); + + var fixtureDef = new Box2D.Dynamics.b2FixtureDef(); + fixtureDef.shape = deckShape; + + var offset = 4, + factor = 80; + var density = ((this.options.weight + offset) / this.options.width / this.options.height) * factor; + fixtureDef.density = density; + fixtureDef.friction = Settings.ITEM_FRICTION; + fixtureDef.restitution = 0.2; + fixtureDef.isSensor = false; + + this.body.CreateFixture(fixtureDef); + + + this.addWheel( + -8, + -2.5 + ); + + this.addWheel( + 7, + -2.5 + ); + + }; + + + + Skateboard.prototype.addWheel = function(x, y) { + Assert.number(x, y); + + var bodyDef = new Box2D.Dynamics.b2BodyDef(); + bodyDef.type = Box2D.Dynamics.b2Body.b2_dynamicBody; + bodyDef.position.x = x / Settings.RATIO; + bodyDef.position.y = y / Settings.RATIO; + bodyDef.angle = 0; + + var wheelShape = new Box2D.Collision.Shapes.b2CircleShape(); + wheelShape.SetRadius(2.5 / Settings.RATIO); + wheelShape.SetLocalPosition(new Box2D.Common.Math.b2Vec2(x / Settings.RATIO, y / Settings.RATIO)); + + + var fixtureDef = new Box2D.Dynamics.b2FixtureDef(); + var offset = 4, + factor = 80; + var density = ((0.1 + offset) / 3 / 3) * factor; + fixtureDef.density = density; + fixtureDef.shape = wheelShape; + fixtureDef.restitution = 0.2; + fixtureDef.isSensor = false; + fixtureDef.friction = 0.0005; + + this.body.CreateFixture(fixtureDef); + }; + + + + Skateboard.prototype.flip = function(direction) { + this.flipDirection = direction; + + // FIXME: implement body flip if necessary + }; + + + + return Skateboard; + +}); + + +/* +define([ + "Game/" + GLOBALS.context + "/GameObjects/Item", + "Lib/Vendor/Box2D", + "Game/Config/Settings", + "Lib/Utilities/Assert" +], + +function (Parent, Box2D, Settings, Assert) { + + "use strict"; + + function Skateboard(physicsEngine, uid, options) { + + Parent.call(this, physicsEngine, uid, options); this.wheels = [ - this.addWheel( - options.x + 8, - options.y - 1.5 - ), - this.addWheel( - options.x - 8, - options.y - 1.5 - ) + this.addWheel( + options.x + 8, + options.y - 1.5 + ), + this.addWheel( + options.x - 8, + options.y - 1.5 + ) ]; } @@ -53,13 +151,13 @@ function (Parent, Box2D, Settings, Assert) { Skateboard.prototype.addWheel = function(x, y) { Assert.number(x, y); - var bodyDef = new Box2D.Dynamics.b2BodyDef(); + var bodyDef = new Box2D.Dynamics.b2BodyDef(); bodyDef.type = Box2D.Dynamics.b2Body.b2_dynamicBody; bodyDef.position.x = x / Settings.RATIO; bodyDef.position.y = y / Settings.RATIO; bodyDef.angle = 0; - var wheelShape = new Box2D.Collision.Shapes.b2CircleShape(); + var wheelShape = new Box2D.Collision.Shapes.b2CircleShape(); wheelShape.SetRadius(1.5 / Settings.RATIO); wheelShape.SetLocalPosition(new Box2D.Common.Math.b2Vec2(0, 0)); @@ -75,18 +173,18 @@ function (Parent, Box2D, Settings, Assert) { var wheelBody = this.body.GetWorld().CreateBody(bodyDef); wheelBody.CreateFixture(fixtureDef); - //var revoluteJointDef = new Box2D.Dynamics.Joints.b2RevoluteJointDef(); + //var revoluteJointDef = new Box2D.Dynamics.Joints.b2RevoluteJointDef(); var revoluteJointDef = new Box2D.Dynamics.Joints.b2WeldJointDef(); - //revoluteJointDef.enableMotor = false; + //revoluteJointDef.enableMotor = false; - revoluteJointDef.Initialize(this.body, wheelBody, wheelBody.GetWorldCenter()); - var j = this.body.GetWorld().CreateJoint(revoluteJointDef); + revoluteJointDef.Initialize(this.body, wheelBody, wheelBody.GetWorldCenter()); + var j = this.body.GetWorld().CreateJoint(revoluteJointDef); - // FIXME this means, that we will have bodies in the world, which must not be - // updated (wheels) because they are always connected to a body which will be updated. + // FIXME this means, that we will have bodies in the world, which must not be + // updated (wheels) because they are always connected to a body which will be updated. return wheelBody; }; @@ -116,4 +214,5 @@ function (Parent, Box2D, Settings, Assert) { return Skateboard; -}); \ No newline at end of file +}); +*/ \ No newline at end of file diff --git a/app/Game/Core/Loader/Level.js b/app/Game/Core/Loader/Level.js index 84b0c68..53b43d8 100755 --- a/app/Game/Core/Loader/Level.js +++ b/app/Game/Core/Loader/Level.js @@ -46,8 +46,8 @@ define([ Level.prototype.createItem = function(uid, options) { switch(options.type) { - //case "skateboard": - // return new Skateboard(this.engine, uid, options); + case "skateboard": + return new Skateboard(this.engine, uid, options); case "ragdoll": return new RagDoll(this.engine, uid, options); case "rube": From 09eaf1a85c091d92821467143b4d62a16954f68d Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 20 Apr 2015 15:59:07 +0200 Subject: [PATCH 03/68] added skateboard to debug --- static/maps/tiled/debug.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/maps/tiled/debug.json b/static/maps/tiled/debug.json index a58c9ef..d8e0842 100644 --- a/static/maps/tiled/debug.json +++ b/static/maps/tiled/debug.json @@ -221,11 +221,11 @@ }, "rotation":0, - "type":"", + "type":"rube", "visible":true, "width":0, "x":236.607333333333, - "y":471.255333333333 + "y":462.255333333333 }, { "height":0, @@ -290,7 +290,7 @@ { "height":0, "id":15, - "name":"Piano", + "name":"Skateboard", "properties": { From b12bf2bb0c0e7b641409519dbbec6cf2a7ae9b27 Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 20 Apr 2015 16:00:07 +0200 Subject: [PATCH 04/68] rebuilt skateboard without joints --- app/Game/Core/GameObjects/Items/Skateboard.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/Game/Core/GameObjects/Items/Skateboard.js b/app/Game/Core/GameObjects/Items/Skateboard.js index ae4e00a..1e12df6 100755 --- a/app/Game/Core/GameObjects/Items/Skateboard.js +++ b/app/Game/Core/GameObjects/Items/Skateboard.js @@ -51,8 +51,6 @@ function (Parent, Box2D, Settings, Assert) { }; - - Skateboard.prototype.addWheel = function(x, y) { Assert.number(x, y); @@ -80,15 +78,9 @@ function (Parent, Box2D, Settings, Assert) { this.body.CreateFixture(fixtureDef); }; - - Skateboard.prototype.flip = function(direction) { this.flipDirection = direction; - - // FIXME: implement body flip if necessary }; - - return Skateboard; From c67ff78aa0bbbe7e9e6fd0dad64e2c93754e1735 Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 20 Apr 2015 21:20:56 +0200 Subject: [PATCH 05/68] implemented rubedoll level item (not after dying yet) --- app/Game/Asset/RubeDoll.json | 788 +++++++++ .../Items/{Rube.js => RubeDoll.js} | 2 +- app/Game/Client/GameObjects/Items/Rube.js | 28 - app/Game/Client/GameObjects/Items/RubeDoll.js | 187 +++ app/Game/Config/ItemSettings.js | 12 +- app/Game/Core/GameObjects/Items/Rube.js | 1412 ----------------- app/Game/Core/GameObjects/Items/RubeDoll.js | 66 + app/Game/Core/Loader/Level.js | 8 +- app/Lib/Vendor/RequireJs/Plugin/Json.js | 72 + app/Lib/Vendor/RequireJs/Plugin/Text.js | 391 +++++ channel.js | 6 +- client.js | 2 + config/build-profile.js | 2 + static/items/rube/ragdoll-full.json | 1346 ++++++++++++++++ static/items/rube/ragdoll.rube | 828 ++++------ static/maps/tiled/debug.json | 12 +- 16 files changed, 3140 insertions(+), 2022 deletions(-) create mode 100644 app/Game/Asset/RubeDoll.json rename app/Game/Channel/GameObjects/Items/{Rube.js => RubeDoll.js} (63%) delete mode 100644 app/Game/Client/GameObjects/Items/Rube.js create mode 100644 app/Game/Client/GameObjects/Items/RubeDoll.js delete mode 100644 app/Game/Core/GameObjects/Items/Rube.js create mode 100644 app/Game/Core/GameObjects/Items/RubeDoll.js create mode 100644 app/Lib/Vendor/RequireJs/Plugin/Json.js create mode 100644 app/Lib/Vendor/RequireJs/Plugin/Text.js create mode 100644 static/items/rube/ragdoll-full.json diff --git a/app/Game/Asset/RubeDoll.json b/app/Game/Asset/RubeDoll.json new file mode 100644 index 0000000..114e29f --- /dev/null +++ b/app/Game/Asset/RubeDoll.json @@ -0,0 +1,788 @@ + +{ + "allowSleep" : true, + "autoClearForces" : true, + "body" : + [ + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.04692991077899933, + 0.04692991077899933, + -0.04692997038364410, + -0.04692997038364410 + ], + "y" : + [ + -0.1895973682403564, + 0.1895966529846191, + 0.1895966529846191, + -0.1895973682403564 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0004525936674326658, + "massData-center" : + { + "x" : -2.980232238769531e-08, + "y" : -3.576278686523438e-07 + }, + "massData-mass" : 0.03559110686182976, + "name" : "upperLeftArm", + "position" : + { + "x" : -0.1362041532993317, + "y" : 0.9068759679794312 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture0", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.1402979493141174, + 0.1375417709350586, + 0.001378186047077179, + -0.1402979493141174, + -0.1402979493141174, + 0.001192390918731689 + ], + "y" : + [ + -0.3207050263881683, + 0.4018019437789917, + 0.4018019437789917, + 0.3136067390441895, + -0.3432337343692780, + -0.3689299821853638 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.01047351956367493, + "massData-center" : + { + "x" : 0.001456731930375099, + "y" : 0.01425695233047009 + }, + "massData-mass" : 0.2038488984107971, + "name" : "chest", + "position" : + { + "x" : -0.04104747623205185, + "y" : 0.7829875946044922 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "circle" : + { + "center" : + { + "x" : -0.002679032273590565, + "y" : 0.004700660705566406 + }, + "radius" : 0.2268356680870056 + }, + "density" : 0.2204959988594055, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture1" + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0009180362685583532, + "massData-center" : + { + "x" : -0.002679032273590565, + "y" : 0.004700660705566406 + }, + "massData-mass" : 0.03564291819930077, + "name" : "head", + "position" : + { + "x" : 0.009572610259056091, + "y" : 1.462979435920715 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.04693000018596649, + 0.04693000018596649, + -0.04693005979061127, + -0.04693005979061127 + ], + "y" : + [ + -0.1159216761589050, + 0.1159217953681946, + 0.1159217953681946, + -0.1159216761589050 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0001134485355578363, + "massData-center" : + { + "x" : -2.980232238769531e-08, + "y" : 5.960464477539062e-08 + }, + "massData-mass" : 0.02176084183156490, + "name" : "lowerRightArm", + "position" : + { + "x" : 0.09864036738872528, + "y" : 0.6898344159126282 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.07039503753185272, + 0.07039503753185272, + -0.07039495557546616, + -0.07039495557546616 + ], + "y" : + [ + -0.09294363856315613, + 0.1277718394994736, + 0.1277718394994736, + -0.09294363856315613 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0001869033440016210, + "massData-center" : + { + "x" : 4.097818973036738e-08, + "y" : 0.01741409860551357 + }, + "massData-mass" : 0.03107452951371670, + "name" : "lowerLeftLeg", + "position" : + { + "x" : -0.06537666171789169, + "y" : 0.1036150008440018 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.04693000763654709, + 0.04693000763654709, + -0.04692991077899933, + -0.04692991077899933 + ], + "y" : + [ + -0.1159216761589050, + 0.1159217953681946, + 0.1159217953681946, + -0.1159216761589050 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0001134483172791079, + "massData-center" : + { + "x" : 4.842877032729120e-08, + "y" : 5.960464477539062e-08 + }, + "massData-mass" : 0.02176081016659737, + "name" : "lowerLeftArm", + "position" : + { + "x" : -0.1362059414386749, + "y" : 0.6898344159126282 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.04693000018596649, + 0.04693000018596649, + -0.04693005979061127, + -0.04693005979061127 + ], + "y" : + [ + -0.1895973682403564, + 0.1895966529846191, + 0.1895966529846191, + -0.1895973682403564 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0004525946278590709, + "massData-center" : + { + "x" : -2.980232238769531e-08, + "y" : -3.576278686523438e-07 + }, + "massData-mass" : 0.03559117391705513, + "name" : "upperRightArm", + "position" : + { + "x" : 0.09864036738872528, + "y" : 0.9068759679794312 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.07039496302604675, + 0.07039496302604675, + -0.07039486616849899, + -0.07039486616849899 + ], + "y" : + [ + -0.1890522241592407, + 0.1890524625778198, + 0.1890524625778198, + -0.1890522241592407 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0007221315754577518, + "massData-center" : + { + "x" : 4.842877388000488e-08, + "y" : 1.192092895507812e-07 + }, + "massData-mass" : 0.05323329567909241, + "name" : "upperRightLeg", + "position" : + { + "x" : 0.02818956598639488, + "y" : 0.3381301760673523 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.07039505988359451, + 0.07039505988359451, + -0.07039495557546616, + -0.07039495557546616 + ], + "y" : + [ + -0.1890522241592407, + 0.1890524625778198, + 0.1890524625778198, + -0.1890522241592407 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.000722132739610970, + "massData-center" : + { + "x" : 5.215406417846680e-08, + "y" : 1.192092824453539e-07 + }, + "massData-mass" : 0.05323336645960808, + "name" : "upperLeftLeg", + "position" : + { + "x" : -0.06537666171789169, + "y" : 0.3381301760673523 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.07039496302604675, + 0.07039496302604675, + -0.07039486616849899, + -0.07039486616849899 + ], + "y" : + [ + -0.09294389933347702, + 0.1276105940341949, + 0.1276105940341949, + -0.09294389933347702 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0001864957448560745, + "massData-center" : + { + "x" : 4.842877032729120e-08, + "y" : 0.01733334921300411 + }, + "massData-mass" : 0.03105182945728302, + "name" : "lowerRightLeg", + "position" : + { + "x" : 0.02818956598639488, + "y" : 0.1036150008440018 + }, + "type" : 2 + } + ], + "collisionbitplanes" : + { + "names" : + [ + "bitplane1", + "bitplane2", + "bitplane3", + "bitplane4", + "bitplane5", + "bitplane6", + "bitplane7", + "bitplane8", + "bitplane9", + "bitplane10", + "bitplane11", + "bitplane12", + "bitplane13", + "bitplane14", + "bitplane15", + "bitplane16", + "bitplane17", + "bitplane18", + "bitplane19", + "bitplane20", + "bitplane21", + "bitplane22", + "bitplane23", + "bitplane24", + "bitplane25", + "bitplane26", + "bitplane27", + "bitplane28", + "bitplane29", + "bitplane30", + "bitplane31", + "bitplane32" + ] + }, + "continuousPhysics" : true, + "gravity" : + { + "x" : 0, + "y" : -10 + }, + "joint" : + [ + + { + "anchorA" : + { + "x" : 0.06392270326614380, + "y" : 0.4330990314483643 + }, + "anchorB" : + { + "x" : 0.01330260001122952, + "y" : -0.2468919754028320 + }, + "bodyA" : 1, + "bodyB" : 2, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.6981316804885864, + "maxMotorTorque" : 0, + "motorSpeed" : 0, + "name" : "joint9", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.221730470657349 + }, + + { + "anchorA" : + { + "x" : 0.0008554458618164062, + "y" : -0.1461489200592041 + }, + "anchorB" : + { + "x" : 0.0008557140827178955, + "y" : 0.07089227437973022 + }, + "bodyA" : 0, + "bodyB" : 5, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -1.919862151145935, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint4", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 0.01745329238474369 + }, + + { + "anchorA" : + { + "x" : 0.0003538504242897034, + "y" : 0.07107692956924438 + }, + "anchorB" : + { + "x" : 0.0003536641597747803, + "y" : -0.1459646224975586 + }, + "bodyA" : 3, + "bodyB" : 6, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -1.919862151145935, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint1", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 0.01745329238474369 + }, + + { + "anchorA" : + { + "x" : 0.001979876309633255, + "y" : -0.1506856828927994 + }, + "anchorB" : + { + "x" : 0.001979988068342209, + "y" : 0.08382888138294220 + }, + "bodyA" : 7, + "bodyB" : 9, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0.01745329238474369, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint8", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 2.268928050994873 + }, + + { + "anchorA" : + { + "x" : -0.0007802918553352356, + "y" : -0.1484908312559128 + }, + "anchorB" : + { + "x" : -0.0007800981402397156, + "y" : 0.08614097535610199 + }, + "bodyA" : 8, + "bodyB" : 4, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0.01745329238474369, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint7", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 2.268928050994873 + }, + + { + "anchorA" : + { + "x" : -0.09517393261194229, + "y" : 0.2718780040740967 + }, + "anchorB" : + { + "x" : -1.741945743560791e-05, + "y" : 0.1479903459548950 + }, + "bodyA" : 1, + "bodyB" : 0, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint3", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : 0.1396137326955795, + "y" : 0.2701327800750732 + }, + "anchorB" : + { + "x" : -7.455050945281982e-05, + "y" : 0.1462446451187134 + }, + "bodyA" : 1, + "bodyB" : 6, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint2", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : -0.06799929589033127, + "y" : -0.2890855073928833 + }, + "anchorB" : + { + "x" : -0.04493143409490585, + "y" : 0.1559127867221832 + }, + "bodyA" : 1, + "bodyB" : 8, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.6981316804885864, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint6", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.919862151145935 + }, + + { + "anchorA" : + { + "x" : 0.1116365119814873, + "y" : -0.2944114208221436 + }, + "anchorB" : + { + "x" : 0.04127830639481544, + "y" : 0.1504460573196411 + }, + "bodyA" : 1, + "bodyB" : 7, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.6981316804885864, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint5", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.919862151145935 + } + ], + "positionIterations" : 3, + "stepsPerSecond" : 60.0, + "subStepping" : false, + "velocityIterations" : 8, + "warmStarting" : true +} diff --git a/app/Game/Channel/GameObjects/Items/Rube.js b/app/Game/Channel/GameObjects/Items/RubeDoll.js similarity index 63% rename from app/Game/Channel/GameObjects/Items/Rube.js rename to app/Game/Channel/GameObjects/Items/RubeDoll.js index 455467b..3e27b2b 100644 --- a/app/Game/Channel/GameObjects/Items/Rube.js +++ b/app/Game/Channel/GameObjects/Items/RubeDoll.js @@ -1,5 +1,5 @@ define([ - "Game/Core/GameObjects/Items/Rube" + "Game/Core/GameObjects/Items/RubeDoll" ], function (Parent) { diff --git a/app/Game/Client/GameObjects/Items/Rube.js b/app/Game/Client/GameObjects/Items/Rube.js deleted file mode 100644 index 4aa825b..0000000 --- a/app/Game/Client/GameObjects/Items/Rube.js +++ /dev/null @@ -1,28 +0,0 @@ -define([ - "Game/Core/GameObjects/Items/Rube" -], - -function (Parent) { - - "use strict"; - - function Rube(physicsEngine, uid, options) { - Parent.call(this, physicsEngine, uid, options); - } - - Rube.prototype = Object.create(Parent.prototype); - - Rube.prototype.createMesh = function() { - }; - - Rube.prototype.destroy = function() { - }; - - Rube.prototype.render = function() { - } - - Rube.prototype.flip = function(direction) { - }; - - return Rube; -}); \ No newline at end of file diff --git a/app/Game/Client/GameObjects/Items/RubeDoll.js b/app/Game/Client/GameObjects/Items/RubeDoll.js new file mode 100644 index 0000000..2c76d91 --- /dev/null +++ b/app/Game/Client/GameObjects/Items/RubeDoll.js @@ -0,0 +1,187 @@ +define([ + "Game/Core/GameObjects/Items/RubeDoll", + "Game/Client/View/Abstract/Layer", + "Game/Config/Settings", + "Lib/Utilities/NotificationCenter", +], + +function (Parent, Layer, Settings, Nc) { + + "use strict"; + + function RubeDoll(physicsEngine, uid, options) { + + this.primaryColor = 0x008800; + + var limbOptions = {}; + + limbOptions.chest = { + width: 6, + height: 18, + x: 0, + y: 0 + }; + + limbOptions.head = { + width: 10, + height: 12, + x: 0, + y: - limbOptions.chest.height / 2 - 7 + }; + + limbOptions.upperLeftLeg = { + width: 5, + height: 8, + x: -2, + y: limbOptions.chest.height / 2 + }; + + limbOptions.upperRightLeg = { + width: 4, + height: 9, + x: 2, + y: limbOptions.chest.height / 2 + }; + + limbOptions.lowerLeftLeg = { + width: 4, + height: 4, + x: -2, + y: limbOptions.chest.height / 2 + limbOptions.upperLeftLeg.height + }; + + limbOptions.lowerRightLeg = { + width: 4, + height: 4, + x: 2, + y: limbOptions.chest.height / 2 + limbOptions.upperRightLeg.height + }; + + + + limbOptions.upperLeftArm = { + width: 2, + height: 8, + x: -2, + y: -limbOptions.chest.height / 2 + }; + + limbOptions.upperRightArm = { + width: 3, + height: 8, + x: 2, + y: -limbOptions.chest.height / 2 + }; + + limbOptions.lowerLeftArm = { + width: 2, + height: 5, + x: -2, + y: -limbOptions.chest.height / 2 + limbOptions.upperLeftArm.height + }; + + limbOptions.lowerRightArm = { + width: 2, + height: 5, + x: 2, + y: -limbOptions.chest.height / 2 + limbOptions.upperRightArm.height + }; + + this.limbOptions = limbOptions; + + this.layerId = Layer.ID.SPAWN; + this.limbMeshes = {}; + this.baseMeshName = "chest"; + this.characterName = "Chuck"; + + Parent.call(this, physicsEngine, uid, options); + } + + RubeDoll.prototype = Object.create(Parent.prototype); + + RubeDoll.prototype.createMesh = function() { + + + this.createLimbMesh("lowerRightLeg"); + this.createLimbMesh("upperRightLeg"); + + this.createLimbMesh("lowerRightArm"); + this.createLimbMesh("upperRightArm"); + + this.createLimbMesh("chest"); + this.createLimbMesh("head"); + + this.createLimbMesh("lowerLeftLeg"); + this.createLimbMesh("upperLeftLeg"); + + this.createLimbMesh("lowerLeftArm"); + this.createLimbMesh("upperLeftArm"); + + }; + + RubeDoll.prototype.createLimbMesh = function(name) { + var self = this; + var texturePath = Settings.GRAPHICS_PATH + + Settings.GRAPHICS_SUBPATH_CHARACTERS + "" + + this.characterName + '/'; + + + var callback = function(mesh) { + if(name == self.baseMeshName) { + self.mesh = mesh; + } + + self.limbMeshes[name] = mesh; + + Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh); + + // setting shirt color + Nc.trigger(Nc.ns.client.view.mesh.addFilter, self.layerId, mesh, "colorRangeReplace", { + minColor: 0x3b4a31, + maxColor: 0x6d855d, + newColor: self.primaryColor, + brightnessOffset: 0.56 + }); + }; + + Nc.trigger(Nc.ns.client.view.mesh.create, + this.layerId, + texturePath + name + ".png", + callback, + { + width: this.limbOptions[name].width, + height: this.limbOptions[name].height, + pivot: { + x: this.limbOptions[name].width / 2, + y: this.limbOptions[name].height / 2 + } + } + ); + }; + + RubeDoll.prototype.destroy = function() { + }; + + RubeDoll.prototype.render = function() { + if(this.limbs) { + for(var name in this.limbMeshes) { + if(this.limbs[name]) { + Nc.trigger(Nc.ns.client.view.mesh.update, + this.layerId, + this.limbMeshes[name], + { + x: this.limbs[name].GetPosition().x * Settings.RATIO, + y: this.limbs[name].GetPosition().y * Settings.RATIO, + rotation: this.limbs[name].GetAngle() + } + ); + } + } + } + }; + + RubeDoll.prototype.flip = function(direction) { + }; + + return RubeDoll; +}); \ No newline at end of file diff --git a/app/Game/Config/ItemSettings.js b/app/Game/Config/ItemSettings.js index 0546123..532d6fc 100644 --- a/app/Game/Config/ItemSettings.js +++ b/app/Game/Config/ItemSettings.js @@ -411,19 +411,17 @@ function () { }, - - - "Rube": + "RubeDoll": { "category": "kitchen", "image": "banana.gif", - - // "type": "rube", - "weight": "1", + + "weight": "3", "width": "5", "height": "9", - "grabAngle": "0.5", + "type": "rubedoll", + "grabAngle": "0", } }; diff --git a/app/Game/Core/GameObjects/Items/Rube.js b/app/Game/Core/GameObjects/Items/Rube.js deleted file mode 100644 index ccc06a6..0000000 --- a/app/Game/Core/GameObjects/Items/Rube.js +++ /dev/null @@ -1,1412 +0,0 @@ -define([ - "Game/" + GLOBALS.context + "/GameObjects/Item", - "Lib/Vendor/RubeLoader", - "Lib/Vendor/Box2D", - "Game/Config/Settings", - "Lib/Utilities/Assert" -], - -function (Parent, RubeLoader, Box2D, Settings, Assert) { - - "use strict"; - - // Fixme - make this loadable - var __ragdollJson; - - function Rube(physicsEngine, uid, options) { - Assert.number(options.x, options.y); - - this.rubeLoader = null; - this.body = null; - - Parent.call(this, physicsEngine, uid, options); - var world = physicsEngine.getWorld(); - world.DestroyBody(this.body); - - var json = __ragdollJson; - - this.rubeLoader = new RubeLoader(json, world); - var scene = this.rubeLoader.getScene(); - - for (var i in scene.bodies) { - var body = scene.bodies[i]; - var position = body.GetPosition().Copy(); - position.Add(new Box2D.Common.Math.b2Vec2( - options.x / Settings.RATIO, - options.y / Settings.RATIO - )); - body.SetPosition(position); - - if(body.name == "chest"){ - this.body = body; - } - } - - var def = this.body.GetDefinition(); - def.userData = this; - this.body.SetUserData(this); - } - - Rube.prototype = Object.create(Parent.prototype); - - Rube.prototype.flip = function(direction) { - Parent.prototype.flip.call(this, direction); - // Extend - }; - - __ragdollJson = - -{ - "allowSleep" : true, - "autoClearForces" : true, - "body" : - [ - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.05748672783374786, - 0.05748672783374786, - -0.05748683214187622, - -0.05748683214187622 - ], - "y" : - [ - -0.2322469353675842, - 0.2322462797164917, - 0.2322462797164917, - -0.2322469353675842 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.001019014045596123, - "massData-center" : - { - "x" : -5.215406062575312e-08, - "y" : -3.278255462646484e-07 - }, - "massData-mass" : 0.05340443924069405, - "name" : "upperArmLeft", - "position" : - { - "x" : -0.1699507087469101, - "y" : 1.113796472549438 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture0", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.1718577891588211, - 0.1684816330671310, - 0.001688212156295776, - -0.1718577295541763, - -0.1718577295541763, - 0.001460619270801544 - ], - "y" : - [ - -0.3928470611572266, - 0.4921868443489075, - 0.4921868443489075, - 0.3841522336006165, - -0.4204435348510742, - -0.4519201517105103 - ] - } - } - }, - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture2", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.1679489463567734, - 0.1679489463567734, - -0.004204027354717255, - -0.004204027354717255 - ], - "y" : - [ - 0.4449140429496765, - 0.6170670390129089, - 0.6170670390129089, - 0.4449140429496765 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.03228222951292992, - "massData-center" : - { - "x" : 0.008858840912580490, - "y" : 0.06282533705234528 - }, - "massData-mass" : 0.3355117142200470, - "name" : "chest", - "position" : - { - "x" : -0.05338868126273155, - "y" : 0.9620395302772522 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "circle" : - { - "center" : - { - "x" : -0.007499951869249344, - "y" : 0.003749847412109375 - }, - "radius" : 0.2746430933475494 - }, - "density" : 0.2204959988594055, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture1" - }, - - { - "circle" : - { - "center" : - { - "x" : -0.03327952325344086, - "y" : -0.1384725570678711 - }, - "radius" : 0.2485582530498505 - }, - "density" : 0.2204959988594055, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture1" - } - ], - "linearVelocity" : 0, - "massData-I" : 0.004164268728345633, - "massData-center" : - { - "x" : -0.01910765282809734, - "y" : -0.06028826907277107 - }, - "massData-mass" : 0.09504657238721848, - "name" : "head", - "position" : - { - "x" : 0.04257059469819069, - "y" : 1.812389135360718 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.05748683214187622, - 0.05748683214187622, - -0.05748690664768219, - -0.05748690664768219 - ], - "y" : - [ - -0.1419981122016907, - 0.1419981718063354, - 0.1419981718063354, - -0.1419981122016907 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0002554289239924401, - "massData-center" : - { - "x" : -3.725290298461914e-08, - "y" : 2.980232238769531e-08 - }, - "massData-mass" : 0.03265211358666420, - "name" : "lowerArmRight", - "position" : - { - "x" : 0.1177217364311218, - "y" : 0.8479318022727966 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.1415265351533890, - 0.1415265351533890, - -0.08457186818122864, - -0.08457186818122864 - ], - "y" : - [ - -0.1143886670470238, - -0.05680520832538605, - -0.05680520832538605, - -0.1143886670470238 - ] - } - } - }, - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.08623030036687851, - 0.08623030036687851, - -0.08623020350933075, - -0.08623020350933075 - ], - "y" : - [ - -0.1138511821627617, - 0.1565139442682266, - 0.1565139442682266, - -0.1138511821627617 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0005858240183442831, - "massData-center" : - { - "x" : 0.006215983536094427, - "y" : -0.002008607611060143 - }, - "massData-mass" : 0.05964682996273041, - "name" : "lowerLegLeft", - "position" : - { - "x" : -0.08319067955017090, - "y" : 0.1298431605100632 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.05748684704303741, - 0.05748684704303741, - -0.05748672783374786, - -0.05748672783374786 - ], - "y" : - [ - -0.1419981122016907, - 0.1419981718063354, - 0.1419981718063354, - -0.1419981122016907 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0002554284874349833, - "massData-center" : - { - "x" : 5.960464477539062e-08, - "y" : 2.980232238769531e-08 - }, - "massData-mass" : 0.03265206888318062, - "name" : "lowerArmLeft", - "position" : - { - "x" : -0.1699528992176056, - "y" : 0.8479318022727966 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.05748683214187622, - 0.05748683214187622, - -0.05748690664768219, - -0.05748690664768219 - ], - "y" : - [ - -0.2322469353675842, - 0.2322462797164917, - 0.2322462797164917, - -0.2322469353675842 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.001019015791825950, - "massData-center" : - { - "x" : -3.725290298461914e-08, - "y" : -3.278255462646484e-07 - }, - "massData-mass" : 0.05340452119708061, - "name" : "upperArmRight", - "position" : - { - "x" : 0.1177217364311218, - "y" : 1.113796472549438 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.08623021841049194, - 0.08623021841049194, - -0.08623008430004120, - -0.08623008430004120 - ], - "y" : - [ - -0.2315792292356491, - 0.2315795421600342, - 0.2315795421600342, - -0.2315792292356491 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.001625877106562257, - "massData-center" : - { - "x" : 6.705522537231445e-08, - "y" : 1.564621925354004e-07 - }, - "massData-mass" : 0.07987650483846664, - "name" : "upperLegRight", - "position" : - { - "x" : 0.03142313286662102, - "y" : 0.4171121716499329 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.08623032271862030, - 0.08623032271862030, - -0.08623017370700836, - -0.08623017370700836 - ], - "y" : - [ - -0.2315792292356491, - 0.2315795421600342, - 0.2315795421600342, - -0.2315792292356491 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.001625879434868693, - "massData-center" : - { - "x" : 7.450580596923828e-08, - "y" : 1.564621925354004e-07 - }, - "massData-mass" : 0.07987659424543381, - "name" : "upperLegLeft", - "position" : - { - "x" : -0.08319067955017090, - "y" : 0.4171121716499329 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.08623021841049194, - 0.08623021841049194, - -0.08623008430004120, - -0.08623008430004120 - ], - "y" : - [ - -0.1138515025377274, - 0.1563164740800858, - 0.1563164740800858, - -0.1138515025377274 - ] - } - } - }, - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.1415264606475830, - 0.1415264606475830, - -0.08457189798355103, - -0.08457189798355103 - ], - "y" : - [ - -0.1143886670470238, - -0.05680520832538605, - -0.05680520832538605, - -0.1143886670470238 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0005849063745699823, - "massData-center" : - { - "x" : 0.006219535600394011, - "y" : -0.002099231118336320 - }, - "massData-mass" : 0.05961277708411217, - "name" : "lowerLegRight", - "position" : - { - "x" : 0.03142313286662102, - "y" : 0.1298431605100632 - }, - "type" : 2 - } - ], - "collisionbitplanes" : - { - "names" : - [ - "bitplane1", - "bitplane2", - "bitplane3", - "bitplane4", - "bitplane5", - "bitplane6", - "bitplane7", - "bitplane8", - "bitplane9", - "bitplane10", - "bitplane11", - "bitplane12", - "bitplane13", - "bitplane14", - "bitplane15", - "bitplane16", - "bitplane17", - "bitplane18", - "bitplane19", - "bitplane20", - "bitplane21", - "bitplane22", - "bitplane23", - "bitplane24", - "bitplane25", - "bitplane26", - "bitplane27", - "bitplane28", - "bitplane29", - "bitplane30", - "bitplane31", - "bitplane32" - ] - }, - "continuousPhysics" : true, - "gravity" : - { - "x" : 0, - "y" : -10 - }, - "image" : - [ - - { - "aspectScale" : 1, - "body" : 9, - "center" : - { - "x" : 0.02911517955362797, - "y" : -0.0009155124425888062 - }, - "corners" : - { - "x" : - [ - -0.08536797016859055, - 0.1435983330011368, - 0.1435983330011368, - -0.08536797016859055 - ], - "y" : - [ - -0.1153986603021622, - -0.1153986603021622, - 0.1135676354169846, - 0.1135676354169846 - ] - }, - "file" : "../../img/Characters/Chuck/lowerLeftLeg.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.08536797016859055, - -0.1153986603021622, - 0.1435983330011368, - -0.1153986603021622, - 0.1435983330011368, - 0.1135676354169846, - -0.08536797016859055, - 0.1135676354169846 - ], - "name" : "image5", - "opacity" : 1, - "scale" : 0.2289662957191467 - }, - - { - "aspectScale" : 1, - "body" : 7, - "center" : - { - "x" : -0.02732392773032188, - "y" : 0.02671334147453308 - }, - "corners" : - { - "x" : - [ - -0.1425068378448486, - 0.08785898983478546, - 0.08785898983478546, - -0.1425068378448486 - ], - "y" : - [ - -0.2324482202529907, - -0.2324482202529907, - 0.2858749032020569, - 0.2858749032020569 - ] - }, - "file" : "../../img/Characters/Chuck/upperRightLeg.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.1425068378448486, - -0.2324482202529907, - 0.08785898983478546, - -0.2324482202529907, - 0.08785898983478546, - 0.2858749032020569, - -0.1425068378448486, - 0.2858749032020569 - ], - "name" : "image6", - "opacity" : 1, - "scale" : 0.5183231234550476 - }, - - { - "aspectScale" : 1, - "body" : 6, - "center" : - { - "x" : 0.0003027096390724182, - "y" : 0.0006600618362426758 - }, - "corners" : - { - "x" : - [ - -0.05836960300803185, - 0.05897502228617668, - 0.05897502228617668, - -0.05836960300803185 - ], - "y" : - [ - -0.2340291887521744, - -0.2340291887521744, - 0.2353493124246597, - 0.2353493124246597 - ] - }, - "file" : "../../img/Characters/Chuck/upperLeftArm.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.05836960300803185, - -0.2340291887521744, - 0.05897502228617668, - -0.2340291887521744, - 0.05897502228617668, - 0.2353493124246597, - -0.05836960300803185, - 0.2353493124246597 - ], - "name" : "image4", - "opacity" : 1, - "renderOrder" : 1, - "scale" : 0.4693785011768341 - }, - - { - "aspectScale" : 1, - "body" : 3, - "center" : - { - "x" : 0.0007003694772720337, - "y" : 0.001779437065124512 - }, - "corners" : - { - "x" : - [ - -0.05596264451742172, - 0.05736338347196579, - 0.05736338347196579, - -0.05596264451742172 - ], - "y" : - [ - -0.1398780941963196, - -0.1398780941963196, - 0.1434369683265686, - 0.1434369683265686 - ] - }, - "file" : "../../img/Characters/Chuck/lowerLeftArm.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.05596264451742172, - -0.1398780941963196, - 0.05736338347196579, - -0.1398780941963196, - 0.05736338347196579, - 0.1434369683265686, - -0.05596264451742172, - 0.1434369683265686 - ], - "name" : "image3", - "opacity" : 1, - "renderOrder" : 1, - "scale" : 0.2833150625228882 - }, - - { - "aspectScale" : 1, - "body" : 1, - "center" : - { - "x" : -0.0008481591939926147, - "y" : -0.001265347003936768 - }, - "corners" : - { - "x" : - [ - -0.1698881536722183, - 0.1681918352842331, - 0.1681918352842331, - -0.1698881536722183 - ], - "y" : - [ - -0.480212002992630, - -0.480212002992630, - 0.4776813089847565, - 0.4776813089847565 - ] - }, - "file" : "../../img/Characters/Chuck/chest.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.1698881536722183, - -0.480212002992630, - 0.1681918352842331, - -0.480212002992630, - 0.1681918352842331, - 0.4776813089847565, - -0.1698881536722183, - 0.4776813089847565 - ], - "name" : "image2", - "opacity" : 1, - "renderOrder" : 5, - "scale" : 0.9578933119773865 - }, - - { - "aspectScale" : 1, - "body" : 8, - "center" : - { - "x" : 0.003173574805259705, - "y" : -0.001172244548797607 - }, - "corners" : - { - "x" : - [ - -0.1414211541414261, - 0.1477683037519455, - 0.1477683037519455, - -0.1414211541414261 - ], - "y" : - [ - -0.2325238138437271, - -0.2325238138437271, - 0.2301793247461319, - 0.2301793247461319 - ] - }, - "file" : "../../img/Characters/Chuck/upperLeftLeg.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.1414211541414261, - -0.2325238138437271, - 0.1477683037519455, - -0.2325238138437271, - 0.1477683037519455, - 0.2301793247461319, - -0.1414211541414261, - 0.2301793247461319 - ], - "name" : "image6", - "opacity" : 1, - "renderOrder" : 6, - "scale" : 0.4627031385898590 - }, - - { - "aspectScale" : 1, - "body" : 4, - "center" : - { - "x" : 0.02851789817214012, - "y" : -0.0009155124425888062 - }, - "corners" : - { - "x" : - [ - -0.08596524596214294, - 0.1430010497570038, - 0.1430010497570038, - -0.08596524596214294 - ], - "y" : - [ - -0.1153986603021622, - -0.1153986603021622, - 0.1135676354169846, - 0.1135676354169846 - ] - }, - "file" : "../../img/Characters/Chuck/lowerLeftLeg.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.08596524596214294, - -0.1153986603021622, - 0.1430010497570038, - -0.1153986603021622, - 0.1430010497570038, - 0.1135676354169846, - -0.08596524596214294, - 0.1135676354169846 - ], - "name" : "image5", - "opacity" : 1, - "renderOrder" : 6, - "scale" : 0.2289662957191467 - }, - - { - "aspectScale" : 1, - "body" : 2, - "center" : - { - "x" : 0.01975236460566521, - "y" : -0.07194232940673828 - }, - "corners" : - { - "x" : - [ - -0.2679373621940613, - 0.3074420690536499, - 0.3074420690536499, - -0.2679373621940613 - ], - "y" : - [ - -0.4171699881553650, - -0.4171699881553650, - 0.2732853293418884, - 0.2732853293418884 - ] - }, - "file" : "../../img/Characters/Chuck/head.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.2679373621940613, - -0.4171699881553650, - 0.3074420690536499, - -0.4171699881553650, - 0.3074420690536499, - 0.2732853293418884, - -0.2679373621940613, - 0.2732853293418884 - ], - "name" : "image1", - "opacity" : 1, - "renderOrder" : 6, - "scale" : 0.6904553174972534 - }, - - { - "aspectScale" : 1, - "body" : 0, - "center" : - { - "x" : 0.002138927578926086, - "y" : 0.0006600618362426758 - }, - "corners" : - { - "x" : - [ - -0.05653338506817818, - 0.06081124022603035, - 0.06081124022603035, - -0.05653338506817818 - ], - "y" : - [ - -0.2340291887521744, - -0.2340291887521744, - 0.2353493124246597, - 0.2353493124246597 - ] - }, - "file" : "../../img/Characters/Chuck/upperLeftArm.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.05653338506817818, - -0.2340291887521744, - 0.06081124022603035, - -0.2340291887521744, - 0.06081124022603035, - 0.2353493124246597, - -0.05653338506817818, - 0.2353493124246597 - ], - "name" : "image4", - "opacity" : 1, - "renderOrder" : 8, - "scale" : 0.4693785011768341 - }, - - { - "aspectScale" : 1, - "body" : 5, - "center" : - { - "x" : 0.002538725733757019, - "y" : 0.001779437065124512 - }, - "corners" : - { - "x" : - [ - -0.05412428826093674, - 0.05920173972845078, - 0.05920173972845078, - -0.05412428826093674 - ], - "y" : - [ - -0.1398780941963196, - -0.1398780941963196, - 0.1434369683265686, - 0.1434369683265686 - ] - }, - "file" : "../../img/Characters/Chuck/lowerLeftArm.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.05412428826093674, - -0.1398780941963196, - 0.05920173972845078, - -0.1398780941963196, - 0.05920173972845078, - 0.1434369683265686, - -0.05412428826093674, - 0.1434369683265686 - ], - "name" : "image3", - "opacity" : 1, - "renderOrder" : 8, - "scale" : 0.2833150625228882 - } - ], - "joint" : - [ - - { - "anchorA" : - { - "x" : 0.001047849655151367, - "y" : -0.1790249347686768 - }, - "anchorB" : - { - "x" : 0.001048207283020020, - "y" : 0.08683943748474121 - }, - "bodyA" : 0, - "bodyB" : 5, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : 0, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint4", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 1.919862151145935 - }, - - { - "anchorA" : - { - "x" : -0.1165831685066223, - "y" : 0.3330366015434265 - }, - "anchorB" : - { - "x" : -2.135336399078369e-05, - "y" : 0.1812803745269775 - }, - "bodyA" : 1, - "bodyB" : 0, - "enableLimit" : false, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint3", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 3.141592741012573 - }, - - { - "anchorA" : - { - "x" : 0.07454992830753326, - "y" : 0.5068108439445496 - }, - "anchorB" : - { - "x" : -0.02141102217137814, - "y" : -0.3435407876968384 - }, - "bodyA" : 1, - "bodyB" : 2, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -1.221730470657349, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint0", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 0.6981316804885864 - }, - - { - "anchorA" : - { - "x" : 0.1367489844560623, - "y" : -0.3606387376785278 - }, - "anchorB" : - { - "x" : 0.05056380107998848, - "y" : 0.1842886805534363 - }, - "bodyA" : 1, - "bodyB" : 7, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -0.6981316804885864, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint5", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 1.919862151145935 - }, - - { - "anchorA" : - { - "x" : -0.08329562842845917, - "y" : -0.3541148304939270 - }, - "anchorB" : - { - "x" : -0.05503869056701660, - "y" : 0.1909851431846619 - }, - "bodyA" : 1, - "bodyB" : 8, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -0.6981316804885864, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint6", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 1.919862151145935 - }, - - { - "anchorA" : - { - "x" : 0.1710196435451508, - "y" : 0.3308989405632019 - }, - "anchorB" : - { - "x" : -9.131431579589844e-05, - "y" : 0.1791421175003052 - }, - "bodyA" : 1, - "bodyB" : 6, - "enableLimit" : false, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint2", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 3.141592741012573 - }, - - { - "anchorA" : - { - "x" : 0.0004334598779678345, - "y" : 0.08706557750701904 - }, - "anchorB" : - { - "x" : 0.0004332214593887329, - "y" : -0.1787990331649780 - }, - "bodyA" : 3, - "bodyB" : 6, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : 0, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint1", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 1.919862151145935 - }, - - { - "anchorA" : - { - "x" : 0.002425249665975571, - "y" : -0.1845821887254715 - }, - "anchorB" : - { - "x" : 0.002425376325845718, - "y" : 0.1026860624551773 - }, - "bodyA" : 7, - "bodyB" : 9, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint8", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 0 - }, - - { - "anchorA" : - { - "x" : -0.0009558200836181641, - "y" : -0.1818936169147491 - }, - "anchorB" : - { - "x" : -0.0009555891156196594, - "y" : 0.1055182516574860 - }, - "bodyA" : 8, - "bodyB" : 4, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint7", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 0 - } - ], - "positionIterations" : 3, - "stepsPerSecond" : 60.0, - "subStepping" : false, - "velocityIterations" : 8, - "warmStarting" : true -}; - - - - - - - return Rube; - -}); \ No newline at end of file diff --git a/app/Game/Core/GameObjects/Items/RubeDoll.js b/app/Game/Core/GameObjects/Items/RubeDoll.js new file mode 100644 index 0000000..ad3323e --- /dev/null +++ b/app/Game/Core/GameObjects/Items/RubeDoll.js @@ -0,0 +1,66 @@ +define([ + "Game/" + GLOBALS.context + "/GameObjects/Item", + "Lib/Vendor/RubeLoader", + "Lib/Vendor/Box2D", + "Game/Config/Settings", + "Lib/Utilities/Assert", + "json!Game/Asset/RubeDoll.json" // using requirejs json loader plugin +], + +function (Parent, RubeLoader, Box2D, Settings, Assert, RubeDollJson) { + + "use strict"; + + function RubeDoll(physicsEngine, uid, options) { + Assert.number(options.x, options.y); + + this.rubeLoader = null; + this.body = null; + this.limbs = {}; + + var chest = null; + var world = physicsEngine.getWorld(); + this.rubeLoader = new RubeLoader(RubeDollJson, world); + var scene = this.rubeLoader.getScene(); + + for (var i in scene.bodies) { + var body = scene.bodies[i]; + var position = body.GetPosition().Copy(); + position.Add(new Box2D.Common.Math.b2Vec2( + options.x / Settings.RATIO, + options.y / Settings.RATIO + )); + body.SetPosition(position); + this.limbs[body.name] = body; + } + + Parent.call(this, physicsEngine, uid, options); + world.DestroyBody(this.body); + this.body = this.limbs.chest; + + var def = this.body.GetDefinition(); + def.userData = this; + this.body.SetUserData(this); + } + + RubeDoll.prototype = Object.create(Parent.prototype); + + RubeDoll.prototype.flip = function(direction) { + Parent.prototype.flip.call(this, direction); + // Extend + }; + + RubeDoll.prototype.reposition = function(handPosition, direction) { + + Parent.prototype.reposition.call(this, handPosition, direction); + + var position = new Box2D.Common.Math.b2Vec2( + handPosition.x + ((6 / Settings.RATIO) * direction), + handPosition.y + ); + + this.body.SetPosition(position); + }; + + return RubeDoll; +}); \ No newline at end of file diff --git a/app/Game/Core/Loader/Level.js b/app/Game/Core/Loader/Level.js index 53b43d8..bd49a20 100755 --- a/app/Game/Core/Loader/Level.js +++ b/app/Game/Core/Loader/Level.js @@ -8,9 +8,9 @@ define([ "Game/" + GLOBALS.context + "/GameObjects/Item", "Game/" + GLOBALS.context + "/GameObjects/Items/Skateboard", "Game/" + GLOBALS.context + "/GameObjects/Items/RagDoll", - "Game/" + GLOBALS.context + "/GameObjects/Items/Rube" + "Game/" + GLOBALS.context + "/GameObjects/Items/RubeDoll" -], function (Settings, Box2D, Nc, Abstract, CollisionDetector, Tile, Item, Skateboard, RagDoll, Rube) { +], function (Settings, Box2D, Nc, Abstract, CollisionDetector, Tile, Item, Skateboard, RagDoll, RubeDoll) { "use strict"; @@ -50,8 +50,8 @@ define([ return new Skateboard(this.engine, uid, options); case "ragdoll": return new RagDoll(this.engine, uid, options); - case "rube": - return new Rube(this.engine, uid, options); + case "rubedoll": + return new RubeDoll(this.engine, uid, options); default: return new Item(this.engine, uid, options); } diff --git a/app/Lib/Vendor/RequireJs/Plugin/Json.js b/app/Lib/Vendor/RequireJs/Plugin/Json.js new file mode 100644 index 0000000..f62f568 --- /dev/null +++ b/app/Lib/Vendor/RequireJs/Plugin/Json.js @@ -0,0 +1,72 @@ +/** @license + * RequireJS plugin for loading JSON files + * - depends on Text plugin and it was HEAVILY "inspired" by it as well. + * Author: Miller Medeiros + * Version: 0.4.0 (2014/04/10) + * Released under the MIT license + */ +define(['text'], function(text){ + + var CACHE_BUST_QUERY_PARAM = 'bust', + CACHE_BUST_FLAG = '!bust', + jsonParse = (typeof JSON !== 'undefined' && typeof JSON.parse === 'function')? JSON.parse : function(val){ + return eval('('+ val +')'); //quick and dirty + }, + buildMap = {}; + + function cacheBust(url){ + url = url.replace(CACHE_BUST_FLAG, ''); + url += (url.indexOf('?') < 0)? '?' : '&'; + return url + CACHE_BUST_QUERY_PARAM +'='+ Math.round(2147483647 * Math.random()); + } + + //API + return { + + load : function(name, req, onLoad, config) { + if (( config.isBuild && (config.inlineJSON === false || name.indexOf(CACHE_BUST_QUERY_PARAM +'=') !== -1)) || (req.toUrl(name).indexOf('empty:') === 0)) { + //avoid inlining cache busted JSON or if inlineJSON:false + //and don't inline files marked as empty! + onLoad(null); + } else { + text.get(req.toUrl(name), function(data){ + var parsed; + if (config.isBuild) { + buildMap[name] = data; + onLoad(data); + } else { + try { + parsed = jsonParse(data); + } catch (e) { + onLoad.error(e); + } + onLoad(parsed); + } + }, + onLoad.error, { + accept: 'application/json' + } + ); + } + }, + + normalize : function (name, normalize) { + // used normalize to avoid caching references to a "cache busted" request + if (name.indexOf(CACHE_BUST_FLAG) !== -1) { + name = cacheBust(name); + } + // resolve any relative paths + return normalize(name); + }, + + //write method based on RequireJS official text plugin by James Burke + //https://github.com/jrburke/requirejs/blob/master/text.js + write : function(pluginName, moduleName, write){ + if(moduleName in buildMap){ + var content = buildMap[moduleName]; + write('define("'+ pluginName +'!'+ moduleName +'", function(){ return '+ content +';});\n'); + } + } + + }; +}); \ No newline at end of file diff --git a/app/Lib/Vendor/RequireJs/Plugin/Text.js b/app/Lib/Vendor/RequireJs/Plugin/Text.js new file mode 100644 index 0000000..148c553 --- /dev/null +++ b/app/Lib/Vendor/RequireJs/Plugin/Text.js @@ -0,0 +1,391 @@ +/** + * @license RequireJS text 2.0.14 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/requirejs/text for details + */ +/*jslint regexp: true */ +/*global require, XMLHttpRequest, ActiveXObject, + define, window, process, Packages, + java, location, Components, FileUtils */ + +define(['module'], function (module) { + 'use strict'; + + var text, fs, Cc, Ci, xpcIsWindows, + progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'], + xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, + bodyRegExp = /]*>\s*([\s\S]+)\s*<\/body>/im, + hasLocation = typeof location !== 'undefined' && location.href, + defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\:/, ''), + defaultHostName = hasLocation && location.hostname, + defaultPort = hasLocation && (location.port || undefined), + buildMap = {}, + masterConfig = (module.config && module.config()) || {}; + + text = { + version: '2.0.14', + + strip: function (content) { + //Strips declarations so that external SVG and XML + //documents can be added to a document without worry. Also, if the string + //is an HTML document, only the part inside the body tag is returned. + if (content) { + content = content.replace(xmlRegExp, ""); + var matches = content.match(bodyRegExp); + if (matches) { + content = matches[1]; + } + } else { + content = ""; + } + return content; + }, + + jsEscape: function (content) { + return content.replace(/(['\\])/g, '\\$1') + .replace(/[\f]/g, "\\f") + .replace(/[\b]/g, "\\b") + .replace(/[\n]/g, "\\n") + .replace(/[\t]/g, "\\t") + .replace(/[\r]/g, "\\r") + .replace(/[\u2028]/g, "\\u2028") + .replace(/[\u2029]/g, "\\u2029"); + }, + + createXhr: masterConfig.createXhr || function () { + //Would love to dump the ActiveX crap in here. Need IE 6 to die first. + var xhr, i, progId; + if (typeof XMLHttpRequest !== "undefined") { + return new XMLHttpRequest(); + } else if (typeof ActiveXObject !== "undefined") { + for (i = 0; i < 3; i += 1) { + progId = progIds[i]; + try { + xhr = new ActiveXObject(progId); + } catch (e) {} + + if (xhr) { + progIds = [progId]; // so faster next time + break; + } + } + } + + return xhr; + }, + + /** + * Parses a resource name into its component parts. Resource names + * look like: module/name.ext!strip, where the !strip part is + * optional. + * @param {String} name the resource name + * @returns {Object} with properties "moduleName", "ext" and "strip" + * where strip is a boolean. + */ + parseName: function (name) { + var modName, ext, temp, + strip = false, + index = name.lastIndexOf("."), + isRelative = name.indexOf('./') === 0 || + name.indexOf('../') === 0; + + if (index !== -1 && (!isRelative || index > 1)) { + modName = name.substring(0, index); + ext = name.substring(index + 1); + } else { + modName = name; + } + + temp = ext || modName; + index = temp.indexOf("!"); + if (index !== -1) { + //Pull off the strip arg. + strip = temp.substring(index + 1) === "strip"; + temp = temp.substring(0, index); + if (ext) { + ext = temp; + } else { + modName = temp; + } + } + + return { + moduleName: modName, + ext: ext, + strip: strip + }; + }, + + xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/, + + /** + * Is an URL on another domain. Only works for browser use, returns + * false in non-browser environments. Only used to know if an + * optimized .js version of a text resource should be loaded + * instead. + * @param {String} url + * @returns Boolean + */ + useXhr: function (url, protocol, hostname, port) { + var uProtocol, uHostName, uPort, + match = text.xdRegExp.exec(url); + if (!match) { + return true; + } + uProtocol = match[2]; + uHostName = match[3]; + + uHostName = uHostName.split(':'); + uPort = uHostName[1]; + uHostName = uHostName[0]; + + return (!uProtocol || uProtocol === protocol) && + (!uHostName || uHostName.toLowerCase() === hostname.toLowerCase()) && + ((!uPort && !uHostName) || uPort === port); + }, + + finishLoad: function (name, strip, content, onLoad) { + content = strip ? text.strip(content) : content; + if (masterConfig.isBuild) { + buildMap[name] = content; + } + onLoad(content); + }, + + load: function (name, req, onLoad, config) { + //Name has format: some.module.filext!strip + //The strip part is optional. + //if strip is present, then that means only get the string contents + //inside a body tag in an HTML string. For XML/SVG content it means + //removing the declarations so the content can be inserted + //into the current doc without problems. + + // Do not bother with the work if a build and text will + // not be inlined. + if (config && config.isBuild && !config.inlineText) { + onLoad(); + return; + } + + masterConfig.isBuild = config && config.isBuild; + + var parsed = text.parseName(name), + nonStripName = parsed.moduleName + + (parsed.ext ? '.' + parsed.ext : ''), + url = req.toUrl(nonStripName), + useXhr = (masterConfig.useXhr) || + text.useXhr; + + // Do not load if it is an empty: url + if (url.indexOf('empty:') === 0) { + onLoad(); + return; + } + + //Load the text. Use XHR if possible and in a browser. + if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) { + text.get(url, function (content) { + text.finishLoad(name, parsed.strip, content, onLoad); + }, function (err) { + if (onLoad.error) { + onLoad.error(err); + } + }); + } else { + //Need to fetch the resource across domains. Assume + //the resource has been optimized into a JS module. Fetch + //by the module name + extension, but do not include the + //!strip part to avoid file system issues. + req([nonStripName], function (content) { + text.finishLoad(parsed.moduleName + '.' + parsed.ext, + parsed.strip, content, onLoad); + }); + } + }, + + write: function (pluginName, moduleName, write, config) { + if (buildMap.hasOwnProperty(moduleName)) { + var content = text.jsEscape(buildMap[moduleName]); + write.asModule(pluginName + "!" + moduleName, + "define(function () { return '" + + content + + "';});\n"); + } + }, + + writeFile: function (pluginName, moduleName, req, write, config) { + var parsed = text.parseName(moduleName), + extPart = parsed.ext ? '.' + parsed.ext : '', + nonStripName = parsed.moduleName + extPart, + //Use a '.js' file name so that it indicates it is a + //script that can be loaded across domains. + fileName = req.toUrl(parsed.moduleName + extPart) + '.js'; + + //Leverage own load() method to load plugin value, but only + //write out values that do not have the strip argument, + //to avoid any potential issues with ! in file names. + text.load(nonStripName, req, function (value) { + //Use own write() method to construct full module value. + //But need to create shell that translates writeFile's + //write() to the right interface. + var textWrite = function (contents) { + return write(fileName, contents); + }; + textWrite.asModule = function (moduleName, contents) { + return write.asModule(moduleName, fileName, contents); + }; + + text.write(pluginName, nonStripName, textWrite, config); + }, config); + } + }; + + if (masterConfig.env === 'node' || (!masterConfig.env && + typeof process !== "undefined" && + process.versions && + !!process.versions.node && + !process.versions['node-webkit'] && + !process.versions['atom-shell'])) { + //Using special require.nodeRequire, something added by r.js. + fs = require.nodeRequire('fs'); + + text.get = function (url, callback, errback) { + try { + var file = fs.readFileSync(url, 'utf8'); + //Remove BOM (Byte Mark Order) from utf8 files if it is there. + if (file[0] === '\uFEFF') { + file = file.substring(1); + } + callback(file); + } catch (e) { + if (errback) { + errback(e); + } + } + }; + } else if (masterConfig.env === 'xhr' || (!masterConfig.env && + text.createXhr())) { + text.get = function (url, callback, errback, headers) { + var xhr = text.createXhr(), header; + xhr.open('GET', url, true); + + //Allow plugins direct access to xhr headers + if (headers) { + for (header in headers) { + if (headers.hasOwnProperty(header)) { + xhr.setRequestHeader(header.toLowerCase(), headers[header]); + } + } + } + + //Allow overrides specified in config + if (masterConfig.onXhr) { + masterConfig.onXhr(xhr, url); + } + + xhr.onreadystatechange = function (evt) { + var status, err; + //Do not explicitly handle errors, those should be + //visible via console output in the browser. + if (xhr.readyState === 4) { + status = xhr.status || 0; + if (status > 399 && status < 600) { + //An http 4xx or 5xx error. Signal an error. + err = new Error(url + ' HTTP status: ' + status); + err.xhr = xhr; + if (errback) { + errback(err); + } + } else { + callback(xhr.responseText); + } + + if (masterConfig.onXhrComplete) { + masterConfig.onXhrComplete(xhr, url); + } + } + }; + xhr.send(null); + }; + } else if (masterConfig.env === 'rhino' || (!masterConfig.env && + typeof Packages !== 'undefined' && typeof java !== 'undefined')) { + //Why Java, why is this so awkward? + text.get = function (url, callback) { + var stringBuffer, line, + encoding = "utf-8", + file = new java.io.File(url), + lineSeparator = java.lang.System.getProperty("line.separator"), + input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)), + content = ''; + try { + stringBuffer = new java.lang.StringBuffer(); + line = input.readLine(); + + // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324 + // http://www.unicode.org/faq/utf_bom.html + + // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK: + // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058 + if (line && line.length() && line.charAt(0) === 0xfeff) { + // Eat the BOM, since we've already found the encoding on this file, + // and we plan to concatenating this buffer with others; the BOM should + // only appear at the top of a file. + line = line.substring(1); + } + + if (line !== null) { + stringBuffer.append(line); + } + + while ((line = input.readLine()) !== null) { + stringBuffer.append(lineSeparator); + stringBuffer.append(line); + } + //Make sure we return a JavaScript string and not a Java string. + content = String(stringBuffer.toString()); //String + } finally { + input.close(); + } + callback(content); + }; + } else if (masterConfig.env === 'xpconnect' || (!masterConfig.env && + typeof Components !== 'undefined' && Components.classes && + Components.interfaces)) { + //Avert your gaze! + Cc = Components.classes; + Ci = Components.interfaces; + Components.utils['import']('resource://gre/modules/FileUtils.jsm'); + xpcIsWindows = ('@mozilla.org/windows-registry-key;1' in Cc); + + text.get = function (url, callback) { + var inStream, convertStream, fileObj, + readData = {}; + + if (xpcIsWindows) { + url = url.replace(/\//g, '\\'); + } + + fileObj = new FileUtils.File(url); + + //XPCOM, you so crazy + try { + inStream = Cc['@mozilla.org/network/file-input-stream;1'] + .createInstance(Ci.nsIFileInputStream); + inStream.init(fileObj, 1, 0, false); + + convertStream = Cc['@mozilla.org/intl/converter-input-stream;1'] + .createInstance(Ci.nsIConverterInputStream); + convertStream.init(inStream, "utf-8", inStream.available(), + Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER); + + convertStream.readString(inStream.available(), readData); + convertStream.close(); + inStream.close(); + callback(readData.value); + } catch (e) { + throw new Error((fileObj && fileObj.path || '') + ': ' + e); + } + }; + } + return text; +}); \ No newline at end of file diff --git a/channel.js b/channel.js index 27305e9..a94689f 100755 --- a/channel.js +++ b/channel.js @@ -4,7 +4,11 @@ var requirejs = require('requirejs'); requirejs.config({ nodeRequire: require, baseUrl: 'app', - deps: ['Lib/Utilities/Channel/Extensions'] + deps: ['Lib/Utilities/Channel/Extensions'], + paths: { + text: 'Lib/Vendor/RequireJs/Plugin/Text', + json: 'Lib/Vendor/RequireJs/Plugin/Json', + }, }); var inspector = {}; diff --git a/client.js b/client.js index c94262d..b082d49 100755 --- a/client.js +++ b/client.js @@ -7,6 +7,8 @@ requirejs.config({ deps: ['Lib/Utilities/Client/Extensions'], waitSeconds: 0, paths: { + text: 'Lib/Vendor/RequireJs/Plugin/Text', + json: 'Lib/Vendor/RequireJs/Plugin/Json', screenfull: "/screenfull", chart: "/chart", socketio: "/socket.io/socket.io" diff --git a/config/build-profile.js b/config/build-profile.js index ed028e7..e650ccc 100644 --- a/config/build-profile.js +++ b/config/build-profile.js @@ -1,6 +1,8 @@ ({ baseUrl: "../app", paths: { + "text": 'Lib/Vendor/RequireJs/Plugin/Text', + "json": 'Lib/Vendor/RequireJs/Plugin/Json', "screenfull": "../node_modules/screenfull/dist/screenfull", "socketio": "../node_modules/socket.io/node_modules/socket.io-client/dist/socket.io", "chart": "../node_modules/chart.js/Chart" diff --git a/static/items/rube/ragdoll-full.json b/static/items/rube/ragdoll-full.json new file mode 100644 index 0000000..fc81cad --- /dev/null +++ b/static/items/rube/ragdoll-full.json @@ -0,0 +1,1346 @@ + +{ + "allowSleep" : true, + "autoClearForces" : true, + "body" : + [ + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.05748672783374786, + 0.05748672783374786, + -0.05748683214187622, + -0.05748683214187622 + ], + "y" : + [ + -0.2322469353675842, + 0.2322462797164917, + 0.2322462797164917, + -0.2322469353675842 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.001019014045596123, + "massData-center" : + { + "x" : -5.215406062575312e-08, + "y" : -3.278255462646484e-07 + }, + "massData-mass" : 0.05340443924069405, + "name" : "upperArmLeft", + "position" : + { + "x" : -0.1699507087469101, + "y" : 1.113796472549438 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture0", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.1718577891588211, + 0.1684816330671310, + 0.001688212156295776, + -0.1718577295541763, + -0.1718577295541763, + 0.001460619270801544 + ], + "y" : + [ + -0.3928470611572266, + 0.4921868443489075, + 0.4921868443489075, + 0.3841522336006165, + -0.4204435348510742, + -0.4519201517105103 + ] + } + } + }, + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture2", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.1679489463567734, + 0.1679489463567734, + -0.004204027354717255, + -0.004204027354717255 + ], + "y" : + [ + 0.4449140429496765, + 0.6170670390129089, + 0.6170670390129089, + 0.4449140429496765 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.03228222951292992, + "massData-center" : + { + "x" : 0.008858840912580490, + "y" : 0.06282533705234528 + }, + "massData-mass" : 0.3355117142200470, + "name" : "chest", + "position" : + { + "x" : -0.05338868126273155, + "y" : 0.9620395302772522 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "circle" : + { + "center" : + { + "x" : -0.007499951869249344, + "y" : 0.003749847412109375 + }, + "radius" : 0.2746430933475494 + }, + "density" : 0.2204959988594055, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture1" + }, + + { + "circle" : + { + "center" : + { + "x" : -0.03327952325344086, + "y" : -0.1384725570678711 + }, + "radius" : 0.2485582530498505 + }, + "density" : 0.2204959988594055, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture1" + } + ], + "linearVelocity" : 0, + "massData-I" : 0.004164268728345633, + "massData-center" : + { + "x" : -0.01910765282809734, + "y" : -0.06028826907277107 + }, + "massData-mass" : 0.09504657238721848, + "name" : "head", + "position" : + { + "x" : 0.04257059469819069, + "y" : 1.812389135360718 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.05748683214187622, + 0.05748683214187622, + -0.05748690664768219, + -0.05748690664768219 + ], + "y" : + [ + -0.1419981122016907, + 0.1419981718063354, + 0.1419981718063354, + -0.1419981122016907 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0002554289239924401, + "massData-center" : + { + "x" : -3.725290298461914e-08, + "y" : 2.980232238769531e-08 + }, + "massData-mass" : 0.03265211358666420, + "name" : "lowerArmRight", + "position" : + { + "x" : 0.1177217364311218, + "y" : 0.8479318022727966 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.1415265351533890, + 0.1415265351533890, + -0.08457186818122864, + -0.08457186818122864 + ], + "y" : + [ + -0.1143886670470238, + -0.05680520832538605, + -0.05680520832538605, + -0.1143886670470238 + ] + } + } + }, + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.08623030036687851, + 0.08623030036687851, + -0.08623020350933075, + -0.08623020350933075 + ], + "y" : + [ + -0.1138511821627617, + 0.1565139442682266, + 0.1565139442682266, + -0.1138511821627617 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0005858240183442831, + "massData-center" : + { + "x" : 0.006215983536094427, + "y" : -0.002008607611060143 + }, + "massData-mass" : 0.05964682996273041, + "name" : "lowerLegLeft", + "position" : + { + "x" : -0.08319067955017090, + "y" : 0.1298431605100632 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.05748684704303741, + 0.05748684704303741, + -0.05748672783374786, + -0.05748672783374786 + ], + "y" : + [ + -0.1419981122016907, + 0.1419981718063354, + 0.1419981718063354, + -0.1419981122016907 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0002554284874349833, + "massData-center" : + { + "x" : 5.960464477539062e-08, + "y" : 2.980232238769531e-08 + }, + "massData-mass" : 0.03265206888318062, + "name" : "lowerArmLeft", + "position" : + { + "x" : -0.1699528992176056, + "y" : 0.8479318022727966 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.05748683214187622, + 0.05748683214187622, + -0.05748690664768219, + -0.05748690664768219 + ], + "y" : + [ + -0.2322469353675842, + 0.2322462797164917, + 0.2322462797164917, + -0.2322469353675842 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.001019015791825950, + "massData-center" : + { + "x" : -3.725290298461914e-08, + "y" : -3.278255462646484e-07 + }, + "massData-mass" : 0.05340452119708061, + "name" : "upperArmRight", + "position" : + { + "x" : 0.1177217364311218, + "y" : 1.113796472549438 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.08623021841049194, + 0.08623021841049194, + -0.08623008430004120, + -0.08623008430004120 + ], + "y" : + [ + -0.2315792292356491, + 0.2315795421600342, + 0.2315795421600342, + -0.2315792292356491 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.001625877106562257, + "massData-center" : + { + "x" : 6.705522537231445e-08, + "y" : 1.564621925354004e-07 + }, + "massData-mass" : 0.07987650483846664, + "name" : "upperLegRight", + "position" : + { + "x" : 0.03142313286662102, + "y" : 0.4171121716499329 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.08623032271862030, + 0.08623032271862030, + -0.08623017370700836, + -0.08623017370700836 + ], + "y" : + [ + -0.2315792292356491, + 0.2315795421600342, + 0.2315795421600342, + -0.2315792292356491 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.001625879434868693, + "massData-center" : + { + "x" : 7.450580596923828e-08, + "y" : 1.564621925354004e-07 + }, + "massData-mass" : 0.07987659424543381, + "name" : "upperLegLeft", + "position" : + { + "x" : -0.08319067955017090, + "y" : 0.4171121716499329 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.08623021841049194, + 0.08623021841049194, + -0.08623008430004120, + -0.08623008430004120 + ], + "y" : + [ + -0.1138515025377274, + 0.1563164740800858, + 0.1563164740800858, + -0.1138515025377274 + ] + } + } + }, + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.1415264606475830, + 0.1415264606475830, + -0.08457189798355103, + -0.08457189798355103 + ], + "y" : + [ + -0.1143886670470238, + -0.05680520832538605, + -0.05680520832538605, + -0.1143886670470238 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0005849063745699823, + "massData-center" : + { + "x" : 0.006219535600394011, + "y" : -0.002099231118336320 + }, + "massData-mass" : 0.05961277708411217, + "name" : "lowerLegRight", + "position" : + { + "x" : 0.03142313286662102, + "y" : 0.1298431605100632 + }, + "type" : 2 + } + ], + "collisionbitplanes" : + { + "names" : + [ + "bitplane1", + "bitplane2", + "bitplane3", + "bitplane4", + "bitplane5", + "bitplane6", + "bitplane7", + "bitplane8", + "bitplane9", + "bitplane10", + "bitplane11", + "bitplane12", + "bitplane13", + "bitplane14", + "bitplane15", + "bitplane16", + "bitplane17", + "bitplane18", + "bitplane19", + "bitplane20", + "bitplane21", + "bitplane22", + "bitplane23", + "bitplane24", + "bitplane25", + "bitplane26", + "bitplane27", + "bitplane28", + "bitplane29", + "bitplane30", + "bitplane31", + "bitplane32" + ] + }, + "continuousPhysics" : true, + "gravity" : + { + "x" : 0, + "y" : -10 + }, + "image" : + [ + + { + "aspectScale" : 1, + "body" : 9, + "center" : + { + "x" : 0.02911517955362797, + "y" : -0.0009155124425888062 + }, + "corners" : + { + "x" : + [ + -0.08536797016859055, + 0.1435983330011368, + 0.1435983330011368, + -0.08536797016859055 + ], + "y" : + [ + -0.1153986603021622, + -0.1153986603021622, + 0.1135676354169846, + 0.1135676354169846 + ] + }, + "file" : "../../img/Characters/Chuck/lowerLeftLeg.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.08536797016859055, + -0.1153986603021622, + 0.1435983330011368, + -0.1153986603021622, + 0.1435983330011368, + 0.1135676354169846, + -0.08536797016859055, + 0.1135676354169846 + ], + "name" : "image5", + "opacity" : 1, + "scale" : 0.2289662957191467 + }, + + { + "aspectScale" : 1, + "body" : 7, + "center" : + { + "x" : -0.02732392773032188, + "y" : 0.02671334147453308 + }, + "corners" : + { + "x" : + [ + -0.1425068378448486, + 0.08785898983478546, + 0.08785898983478546, + -0.1425068378448486 + ], + "y" : + [ + -0.2324482202529907, + -0.2324482202529907, + 0.2858749032020569, + 0.2858749032020569 + ] + }, + "file" : "../../img/Characters/Chuck/upperRightLeg.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.1425068378448486, + -0.2324482202529907, + 0.08785898983478546, + -0.2324482202529907, + 0.08785898983478546, + 0.2858749032020569, + -0.1425068378448486, + 0.2858749032020569 + ], + "name" : "image6", + "opacity" : 1, + "scale" : 0.5183231234550476 + }, + + { + "aspectScale" : 1, + "body" : 6, + "center" : + { + "x" : 0.0003027096390724182, + "y" : 0.0006600618362426758 + }, + "corners" : + { + "x" : + [ + -0.05836960300803185, + 0.05897502228617668, + 0.05897502228617668, + -0.05836960300803185 + ], + "y" : + [ + -0.2340291887521744, + -0.2340291887521744, + 0.2353493124246597, + 0.2353493124246597 + ] + }, + "file" : "../../img/Characters/Chuck/upperLeftArm.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.05836960300803185, + -0.2340291887521744, + 0.05897502228617668, + -0.2340291887521744, + 0.05897502228617668, + 0.2353493124246597, + -0.05836960300803185, + 0.2353493124246597 + ], + "name" : "image4", + "opacity" : 1, + "renderOrder" : 1, + "scale" : 0.4693785011768341 + }, + + { + "aspectScale" : 1, + "body" : 3, + "center" : + { + "x" : 0.0007003694772720337, + "y" : 0.001779437065124512 + }, + "corners" : + { + "x" : + [ + -0.05596264451742172, + 0.05736338347196579, + 0.05736338347196579, + -0.05596264451742172 + ], + "y" : + [ + -0.1398780941963196, + -0.1398780941963196, + 0.1434369683265686, + 0.1434369683265686 + ] + }, + "file" : "../../img/Characters/Chuck/lowerLeftArm.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.05596264451742172, + -0.1398780941963196, + 0.05736338347196579, + -0.1398780941963196, + 0.05736338347196579, + 0.1434369683265686, + -0.05596264451742172, + 0.1434369683265686 + ], + "name" : "image3", + "opacity" : 1, + "renderOrder" : 1, + "scale" : 0.2833150625228882 + }, + + { + "aspectScale" : 1, + "body" : 1, + "center" : + { + "x" : -0.0008481591939926147, + "y" : -0.001265347003936768 + }, + "corners" : + { + "x" : + [ + -0.1698881536722183, + 0.1681918352842331, + 0.1681918352842331, + -0.1698881536722183 + ], + "y" : + [ + -0.480212002992630, + -0.480212002992630, + 0.4776813089847565, + 0.4776813089847565 + ] + }, + "file" : "../../img/Characters/Chuck/chest.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.1698881536722183, + -0.480212002992630, + 0.1681918352842331, + -0.480212002992630, + 0.1681918352842331, + 0.4776813089847565, + -0.1698881536722183, + 0.4776813089847565 + ], + "name" : "image2", + "opacity" : 1, + "renderOrder" : 5, + "scale" : 0.9578933119773865 + }, + + { + "aspectScale" : 1, + "body" : 8, + "center" : + { + "x" : 0.003173574805259705, + "y" : -0.001172244548797607 + }, + "corners" : + { + "x" : + [ + -0.1414211541414261, + 0.1477683037519455, + 0.1477683037519455, + -0.1414211541414261 + ], + "y" : + [ + -0.2325238138437271, + -0.2325238138437271, + 0.2301793247461319, + 0.2301793247461319 + ] + }, + "file" : "../../img/Characters/Chuck/upperLeftLeg.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.1414211541414261, + -0.2325238138437271, + 0.1477683037519455, + -0.2325238138437271, + 0.1477683037519455, + 0.2301793247461319, + -0.1414211541414261, + 0.2301793247461319 + ], + "name" : "image6", + "opacity" : 1, + "renderOrder" : 6, + "scale" : 0.4627031385898590 + }, + + { + "aspectScale" : 1, + "body" : 4, + "center" : + { + "x" : 0.02851789817214012, + "y" : -0.0009155124425888062 + }, + "corners" : + { + "x" : + [ + -0.08596524596214294, + 0.1430010497570038, + 0.1430010497570038, + -0.08596524596214294 + ], + "y" : + [ + -0.1153986603021622, + -0.1153986603021622, + 0.1135676354169846, + 0.1135676354169846 + ] + }, + "file" : "../../img/Characters/Chuck/lowerLeftLeg.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.08596524596214294, + -0.1153986603021622, + 0.1430010497570038, + -0.1153986603021622, + 0.1430010497570038, + 0.1135676354169846, + -0.08596524596214294, + 0.1135676354169846 + ], + "name" : "image5", + "opacity" : 1, + "renderOrder" : 6, + "scale" : 0.2289662957191467 + }, + + { + "aspectScale" : 1, + "body" : 2, + "center" : + { + "x" : 0.01975236460566521, + "y" : -0.07194232940673828 + }, + "corners" : + { + "x" : + [ + -0.2679373621940613, + 0.3074420690536499, + 0.3074420690536499, + -0.2679373621940613 + ], + "y" : + [ + -0.4171699881553650, + -0.4171699881553650, + 0.2732853293418884, + 0.2732853293418884 + ] + }, + "file" : "../../img/Characters/Chuck/head.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.2679373621940613, + -0.4171699881553650, + 0.3074420690536499, + -0.4171699881553650, + 0.3074420690536499, + 0.2732853293418884, + -0.2679373621940613, + 0.2732853293418884 + ], + "name" : "image1", + "opacity" : 1, + "renderOrder" : 6, + "scale" : 0.6904553174972534 + }, + + { + "aspectScale" : 1, + "body" : 0, + "center" : + { + "x" : 0.002138927578926086, + "y" : 0.0006600618362426758 + }, + "corners" : + { + "x" : + [ + -0.05653338506817818, + 0.06081124022603035, + 0.06081124022603035, + -0.05653338506817818 + ], + "y" : + [ + -0.2340291887521744, + -0.2340291887521744, + 0.2353493124246597, + 0.2353493124246597 + ] + }, + "file" : "../../img/Characters/Chuck/upperLeftArm.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.05653338506817818, + -0.2340291887521744, + 0.06081124022603035, + -0.2340291887521744, + 0.06081124022603035, + 0.2353493124246597, + -0.05653338506817818, + 0.2353493124246597 + ], + "name" : "image4", + "opacity" : 1, + "renderOrder" : 8, + "scale" : 0.4693785011768341 + }, + + { + "aspectScale" : 1, + "body" : 5, + "center" : + { + "x" : 0.002538725733757019, + "y" : 0.001779437065124512 + }, + "corners" : + { + "x" : + [ + -0.05412428826093674, + 0.05920173972845078, + 0.05920173972845078, + -0.05412428826093674 + ], + "y" : + [ + -0.1398780941963196, + -0.1398780941963196, + 0.1434369683265686, + 0.1434369683265686 + ] + }, + "file" : "../../img/Characters/Chuck/lowerLeftArm.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.05412428826093674, + -0.1398780941963196, + 0.05920173972845078, + -0.1398780941963196, + 0.05920173972845078, + 0.1434369683265686, + -0.05412428826093674, + 0.1434369683265686 + ], + "name" : "image3", + "opacity" : 1, + "renderOrder" : 8, + "scale" : 0.2833150625228882 + } + ], + "joint" : + [ + + { + "anchorA" : + { + "x" : 0.001047849655151367, + "y" : -0.1790249347686768 + }, + "anchorB" : + { + "x" : 0.001048207283020020, + "y" : 0.08683943748474121 + }, + "bodyA" : 0, + "bodyB" : 5, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint4", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.919862151145935 + }, + + { + "anchorA" : + { + "x" : -0.1165831685066223, + "y" : 0.3330366015434265 + }, + "anchorB" : + { + "x" : -2.135336399078369e-05, + "y" : 0.1812803745269775 + }, + "bodyA" : 1, + "bodyB" : 0, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint3", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : 0.07454992830753326, + "y" : 0.5068108439445496 + }, + "anchorB" : + { + "x" : -0.02141102217137814, + "y" : -0.3435407876968384 + }, + "bodyA" : 1, + "bodyB" : 2, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -1.221730470657349, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint0", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 0.6981316804885864 + }, + + { + "anchorA" : + { + "x" : 0.1367489844560623, + "y" : -0.3606387376785278 + }, + "anchorB" : + { + "x" : 0.05056380107998848, + "y" : 0.1842886805534363 + }, + "bodyA" : 1, + "bodyB" : 7, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.6981316804885864, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint5", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.919862151145935 + }, + + { + "anchorA" : + { + "x" : -0.08329562842845917, + "y" : -0.3541148304939270 + }, + "anchorB" : + { + "x" : -0.05503869056701660, + "y" : 0.1909851431846619 + }, + "bodyA" : 1, + "bodyB" : 8, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.6981316804885864, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint6", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.919862151145935 + }, + + { + "anchorA" : + { + "x" : 0.1710196435451508, + "y" : 0.3308989405632019 + }, + "anchorB" : + { + "x" : -9.131431579589844e-05, + "y" : 0.1791421175003052 + }, + "bodyA" : 1, + "bodyB" : 6, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint2", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : 0.0004334598779678345, + "y" : 0.08706557750701904 + }, + "anchorB" : + { + "x" : 0.0004332214593887329, + "y" : -0.1787990331649780 + }, + "bodyA" : 3, + "bodyB" : 6, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint1", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.919862151145935 + }, + + { + "anchorA" : + { + "x" : 0.002425249665975571, + "y" : -0.1845821887254715 + }, + "anchorB" : + { + "x" : 0.002425376325845718, + "y" : 0.1026860624551773 + }, + "bodyA" : 7, + "bodyB" : 9, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint8", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 0 + }, + + { + "anchorA" : + { + "x" : -0.0009558200836181641, + "y" : -0.1818936169147491 + }, + "anchorB" : + { + "x" : -0.0009555891156196594, + "y" : 0.1055182516574860 + }, + "bodyA" : 8, + "bodyB" : 4, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint7", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 0 + } + ], + "positionIterations" : 3, + "stepsPerSecond" : 60.0, + "subStepping" : false, + "velocityIterations" : 8, + "warmStarting" : true +} diff --git a/static/items/rube/ragdoll.rube b/static/items/rube/ragdoll.rube index 53f1406..b7f646a 100644 --- a/static/items/rube/ragdoll.rube +++ b/static/items/rube/ragdoll.rube @@ -71,7 +71,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 17, + "id" : 2, "name" : "fixture3", "shapes" : [ @@ -84,67 +84,35 @@ { "x" : [ - -0.08623008430004120, - 0.08623021841049194, - 0.08623021841049194, - -0.08623008430004120 + 0.07039496302604675, + 0.07039496302604675, + -0.07039486616849899, + -0.07039486616849899 ], "y" : [ - -0.1138515025377274, - -0.1138515025377274, - 0.1563164740800858, - 0.1563164740800858 - ] - } - }, - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "id" : 18, - "name" : "fixture3", - "shapes" : - [ - - { - "type" : "polygon" - } - ], - "vertices" : - { - "x" : - [ - -0.08457189798355103, - 0.1415264606475830, - 0.1415264606475830, - -0.08457189798355103 - ], - "y" : - [ - -0.1143886670470238, - -0.1143886670470238, - -0.05680520832538605, - -0.05680520832538605 + -0.09294389933347702, + 0.1276105940341949, + 0.1276105940341949, + -0.09294389933347702 ] } } ], - "id" : 13, + "id" : 1, "linearVelocity" : 0, - "massData-I" : 0.0005849063745699823, + "massData-I" : 0.0001864957448560745, "massData-center" : { - "x" : 0.006219535600394011, - "y" : -0.002099231118336320 + "x" : 4.842877032729120e-08, + "y" : 0.01733334921300411 }, - "massData-mass" : 0.05961277708411217, - "name" : "lowerLegRight", + "massData-mass" : 0.03105182945728302, + "name" : "lowerRightLeg", "position" : { - "x" : 0.03142313286662102, - "y" : 0.1298431605100632 + "x" : 0.02818956598639488, + "y" : 0.1036150008440018 }, "type" : "dynamic" }, @@ -160,7 +128,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 19, + "id" : 3, "name" : "fixture3", "shapes" : [ @@ -173,35 +141,35 @@ { "x" : [ - -0.08623017370700836, - 0.08623032271862030, - 0.08623032271862030, - -0.08623017370700836 + 0.07039505988359451, + 0.07039505988359451, + -0.07039495557546616, + -0.07039495557546616 ], "y" : [ - -0.2315792292356491, - -0.2315792292356491, - 0.2315795421600342, - 0.2315795421600342 + -0.1890522241592407, + 0.1890524625778198, + 0.1890524625778198, + -0.1890522241592407 ] } } ], - "id" : 14, + "id" : 2, "linearVelocity" : 0, - "massData-I" : 0.001625879434868693, + "massData-I" : 0.000722132739610970, "massData-center" : { - "x" : 7.450580596923828e-08, - "y" : 1.564621925354004e-07 + "x" : 5.215406417846680e-08, + "y" : 1.192092824453539e-07 }, - "massData-mass" : 0.07987659424543381, - "name" : "upperLegLeft", + "massData-mass" : 0.05323336645960808, + "name" : "upperLeftLeg", "position" : { - "x" : -0.08319067955017090, - "y" : 0.4171121716499329 + "x" : -0.06537666171789169, + "y" : 0.3381301760673523 }, "type" : "dynamic" }, @@ -217,7 +185,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 20, + "id" : 4, "name" : "fixture3", "shapes" : [ @@ -230,35 +198,35 @@ { "x" : [ - -0.08623008430004120, - 0.08623021841049194, - 0.08623021841049194, - -0.08623008430004120 + 0.07039496302604675, + 0.07039496302604675, + -0.07039486616849899, + -0.07039486616849899 ], "y" : [ - -0.2315792292356491, - -0.2315792292356491, - 0.2315795421600342, - 0.2315795421600342 + -0.1890522241592407, + 0.1890524625778198, + 0.1890524625778198, + -0.1890522241592407 ] } } ], - "id" : 15, + "id" : 3, "linearVelocity" : 0, - "massData-I" : 0.001625877106562257, + "massData-I" : 0.0007221315754577518, "massData-center" : { - "x" : 6.705522537231445e-08, - "y" : 1.564621925354004e-07 + "x" : 4.842877388000488e-08, + "y" : 1.192092895507812e-07 }, - "massData-mass" : 0.07987650483846664, - "name" : "upperLegRight", + "massData-mass" : 0.05323329567909241, + "name" : "upperRightLeg", "position" : { - "x" : 0.03142313286662102, - "y" : 0.4171121716499329 + "x" : 0.02818956598639488, + "y" : 0.3381301760673523 }, "type" : "dynamic" }, @@ -274,7 +242,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 21, + "id" : 5, "name" : "fixture3", "shapes" : [ @@ -287,35 +255,35 @@ { "x" : [ - -0.05748690664768219, - 0.05748683214187622, - 0.05748683214187622, - -0.05748690664768219 + 0.04693000018596649, + 0.04693000018596649, + -0.04693005979061127, + -0.04693005979061127 ], "y" : [ - -0.2322469353675842, - -0.2322469353675842, - 0.2322462797164917, - 0.2322462797164917 + -0.1895973682403564, + 0.1895966529846191, + 0.1895966529846191, + -0.1895973682403564 ] } } ], - "id" : 16, + "id" : 4, "linearVelocity" : 0, - "massData-I" : 0.001019015791825950, + "massData-I" : 0.0004525946278590709, "massData-center" : { - "x" : -3.725290298461914e-08, - "y" : -3.278255462646484e-07 + "x" : -2.980232238769531e-08, + "y" : -3.576278686523438e-07 }, - "massData-mass" : 0.05340452119708061, - "name" : "upperArmRight", + "massData-mass" : 0.03559117391705513, + "name" : "upperRightArm", "position" : { - "x" : 0.1177217364311218, - "y" : 1.113796472549438 + "x" : 0.09864036738872528, + "y" : 0.9068759679794312 }, "type" : "dynamic" }, @@ -331,7 +299,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 22, + "id" : 6, "name" : "fixture3", "shapes" : [ @@ -344,35 +312,35 @@ { "x" : [ - -0.05748672783374786, - 0.05748684704303741, - 0.05748684704303741, - -0.05748672783374786 + 0.04693000763654709, + 0.04693000763654709, + -0.04692991077899933, + -0.04692991077899933 ], "y" : [ - -0.1419981122016907, - -0.1419981122016907, - 0.1419981718063354, - 0.1419981718063354 + -0.1159216761589050, + 0.1159217953681946, + 0.1159217953681946, + -0.1159216761589050 ] } } ], - "id" : 17, + "id" : 5, "linearVelocity" : 0, - "massData-I" : 0.0002554284874349833, + "massData-I" : 0.0001134483172791079, "massData-center" : { - "x" : 5.960464477539062e-08, - "y" : 2.980232238769531e-08 + "x" : 4.842877032729120e-08, + "y" : 5.960464477539062e-08 }, - "massData-mass" : 0.03265206888318062, - "name" : "lowerArmLeft", + "massData-mass" : 0.02176081016659737, + "name" : "lowerLeftArm", "position" : { - "x" : -0.1699528992176056, - "y" : 0.8479318022727966 + "x" : -0.1362059414386749, + "y" : 0.6898344159126282 }, "type" : "dynamic" }, @@ -388,7 +356,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 23, + "id" : 7, "name" : "fixture3", "shapes" : [ @@ -401,67 +369,35 @@ { "x" : [ - -0.08623020350933075, - 0.08623030036687851, - 0.08623030036687851, - -0.08623020350933075 + 0.07039503753185272, + 0.07039503753185272, + -0.07039495557546616, + -0.07039495557546616 ], "y" : [ - -0.1138511821627617, - -0.1138511821627617, - 0.1565139442682266, - 0.1565139442682266 - ] - } - }, - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "id" : 24, - "name" : "fixture3", - "shapes" : - [ - - { - "type" : "polygon" - } - ], - "vertices" : - { - "x" : - [ - -0.08457186818122864, - 0.1415265351533890, - 0.1415265351533890, - -0.08457186818122864 - ], - "y" : - [ - -0.1143886670470238, - -0.1143886670470238, - -0.05680520832538605, - -0.05680520832538605 + -0.09294363856315613, + 0.1277718394994736, + 0.1277718394994736, + -0.09294363856315613 ] } } ], - "id" : 18, + "id" : 6, "linearVelocity" : 0, - "massData-I" : 0.0005858240183442831, + "massData-I" : 0.0001869033440016210, "massData-center" : { - "x" : 0.006215983536094427, - "y" : -0.002008607611060143 + "x" : 4.097818973036738e-08, + "y" : 0.01741409860551357 }, - "massData-mass" : 0.05964682996273041, - "name" : "lowerLegLeft", + "massData-mass" : 0.03107452951371670, + "name" : "lowerLeftLeg", "position" : { - "x" : -0.08319067955017090, - "y" : 0.1298431605100632 + "x" : -0.06537666171789169, + "y" : 0.1036150008440018 }, "type" : "dynamic" }, @@ -477,7 +413,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 25, + "id" : 9, "name" : "fixture3", "shapes" : [ @@ -490,35 +426,35 @@ { "x" : [ - -0.05748690664768219, - 0.05748683214187622, - 0.05748683214187622, - -0.05748690664768219 + 0.04693000018596649, + 0.04693000018596649, + -0.04693005979061127, + -0.04693005979061127 ], "y" : [ - -0.1419981122016907, - -0.1419981122016907, - 0.1419981718063354, - 0.1419981718063354 + -0.1159216761589050, + 0.1159217953681946, + 0.1159217953681946, + -0.1159216761589050 ] } } ], - "id" : 19, + "id" : 7, "linearVelocity" : 0, - "massData-I" : 0.0002554289239924401, + "massData-I" : 0.0001134485355578363, "massData-center" : { - "x" : -3.725290298461914e-08, - "y" : 2.980232238769531e-08 + "x" : -2.980232238769531e-08, + "y" : 5.960464477539062e-08 }, - "massData-mass" : 0.03265211358666420, - "name" : "lowerArmRight", + "massData-mass" : 0.02176084183156490, + "name" : "lowerRightArm", "position" : { - "x" : 0.1177217364311218, - "y" : 0.8479318022727966 + "x" : 0.09864036738872528, + "y" : 0.6898344159126282 }, "type" : "dynamic" }, @@ -534,58 +470,37 @@ "density" : 0.2204959988594055, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 26, + "id" : 10, "name" : "fixture1", "shapes" : [ { - "radius" : 0.2746430933475494, + "radius" : 0.2268356680870056, "type" : "circle" } ], "vertices" : { - "x" : [ -0.007499951869249344 ], - "y" : [ 0.003749847412109375 ] - } - }, - - { - "density" : 0.2204959988594055, - "filter-groupIndex" : -55, - "friction" : 0.2, - "id" : 27, - "name" : "fixture1", - "shapes" : - [ - - { - "radius" : 0.2485582530498505, - "type" : "circle" - } - ], - "vertices" : - { - "x" : [ -0.03327952325344086 ], - "y" : [ -0.1384725570678711 ] + "x" : [ -0.002679032273590565 ], + "y" : [ 0.004700660705566406 ] } } ], - "id" : 20, + "id" : 8, "linearVelocity" : 0, - "massData-I" : 0.004164268728345633, + "massData-I" : 0.0009180362685583532, "massData-center" : { - "x" : -0.01910765282809734, - "y" : -0.06028826907277107 + "x" : -0.002679032273590565, + "y" : 0.004700660705566406 }, - "massData-mass" : 0.09504657238721848, + "massData-mass" : 0.03564291819930077, "name" : "head", "position" : { - "x" : 0.04257059469819069, - "y" : 1.812389135360718 + "x" : 0.009572610259056091, + "y" : 1.462979435920715 }, "type" : "dynamic" }, @@ -601,7 +516,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 28, + "id" : 13, "name" : "fixture0", "shapes" : [ @@ -614,71 +529,39 @@ { "x" : [ - -0.1718577295541763, - 0.001460619270801544, - 0.1718577891588211, - 0.1684816330671310, - 0.001688212156295776, - -0.1718577295541763 + 0.1402979493141174, + 0.1375417709350586, + 0.001378186047077179, + -0.1402979493141174, + -0.1402979493141174, + 0.001192390918731689 ], "y" : [ - -0.4204435348510742, - -0.4519201517105103, - -0.3928470611572266, - 0.4921868443489075, - 0.4921868443489075, - 0.3841522336006165 - ] - } - }, - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "id" : 29, - "name" : "fixture2", - "shapes" : - [ - - { - "type" : "polygon" - } - ], - "vertices" : - { - "x" : - [ - -0.004204027354717255, - 0.1679489463567734, - 0.1679489463567734, - -0.004204027354717255 - ], - "y" : - [ - 0.4449140429496765, - 0.4449140429496765, - 0.6170670390129089, - 0.6170670390129089 + -0.3207050263881683, + 0.4018019437789917, + 0.4018019437789917, + 0.3136067390441895, + -0.3432337343692780, + -0.3689299821853638 ] } } ], - "id" : 21, + "id" : 9, "linearVelocity" : 0, - "massData-I" : 0.03228222951292992, + "massData-I" : 0.01047351956367493, "massData-center" : { - "x" : 0.008858840912580490, - "y" : 0.06282533705234528 + "x" : 0.001456731930375099, + "y" : 0.01425695233047009 }, - "massData-mass" : 0.3355117142200470, + "massData-mass" : 0.2038488984107971, "name" : "chest", "position" : { - "x" : -0.05338868126273155, - "y" : 0.9620395302772522 + "x" : -0.04104747623205185, + "y" : 0.7829875946044922 }, "type" : "dynamic" }, @@ -694,7 +577,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 30, + "id" : 14, "name" : "fixture3", "shapes" : [ @@ -707,318 +590,137 @@ { "x" : [ - -0.05748683214187622, - 0.05748672783374786, - 0.05748672783374786, - -0.05748683214187622 + 0.04692991077899933, + 0.04692991077899933, + -0.04692997038364410, + -0.04692997038364410 ], "y" : [ - -0.2322469353675842, - -0.2322469353675842, - 0.2322462797164917, - 0.2322462797164917 + -0.1895973682403564, + 0.1895966529846191, + 0.1895966529846191, + -0.1895973682403564 ] } } ], - "id" : 22, + "id" : 10, "linearVelocity" : 0, - "massData-I" : 0.001019014045596123, + "massData-I" : 0.0004525936674326658, "massData-center" : { - "x" : -5.215406062575312e-08, - "y" : -3.278255462646484e-07 + "x" : -2.980232238769531e-08, + "y" : -3.576278686523438e-07 }, - "massData-mass" : 0.05340443924069405, - "name" : "upperArmLeft", + "massData-mass" : 0.03559110686182976, + "name" : "upperLeftArm", "position" : { - "x" : -0.1699507087469101, - "y" : 1.113796472549438 + "x" : -0.1362041532993317, + "y" : 0.9068759679794312 }, "type" : "dynamic" } ], - "metaimage" : - [ - - { - "aspectScale" : 1, - "body" : 21, - "center" : - { - "x" : -0.0008481591939926147, - "y" : -0.001265347003936768 - }, - "file" : "../../img/Characters/Chuck/chest.png", - "filter" : 0, - "flip" : false, - "id" : 15, - "name" : "image2", - "opacity" : 1, - "renderOrder" : 5, - "scale" : 0.9578933119773865 - }, - - { - "aspectScale" : 1, - "body" : 18, - "center" : - { - "x" : 0.02851789817214012, - "y" : -0.0009155124425888062 - }, - "file" : "../../img/Characters/Chuck/lowerLeftLeg.png", - "filter" : 0, - "flip" : false, - "id" : 16, - "name" : "image5", - "opacity" : 1, - "renderOrder" : 6, - "scale" : 0.2289662957191467 - }, - - { - "aspectScale" : 1, - "body" : 20, - "center" : - { - "x" : 0.01975236460566521, - "y" : -0.07194232940673828 - }, - "file" : "../../img/Characters/Chuck/head.png", - "filter" : 0, - "flip" : false, - "id" : 17, - "name" : "image1", - "opacity" : 1, - "renderOrder" : 6, - "scale" : 0.6904553174972534 - }, - - { - "aspectScale" : 1, - "body" : 22, - "center" : - { - "x" : 0.002138927578926086, - "y" : 0.0006600618362426758 - }, - "file" : "../../img/Characters/Chuck/upperLeftArm.png", - "filter" : 0, - "flip" : false, - "id" : 18, - "name" : "image4", - "opacity" : 1, - "renderOrder" : 8, - "scale" : 0.4693785011768341 - }, - - { - "aspectScale" : 1, - "body" : 16, - "center" : - { - "x" : 0.0003027096390724182, - "y" : 0.0006600618362426758 - }, - "file" : "../../img/Characters/Chuck/upperLeftArm.png", - "filter" : 0, - "flip" : false, - "id" : 19, - "name" : "image4", - "opacity" : 1, - "renderOrder" : 1, - "scale" : 0.4693785011768341 - }, - - { - "aspectScale" : 1, - "body" : 17, - "center" : - { - "x" : 0.002538725733757019, - "y" : 0.001779437065124512 - }, - "file" : "../../img/Characters/Chuck/lowerLeftArm.png", - "filter" : 0, - "flip" : false, - "id" : 20, - "name" : "image3", - "opacity" : 1, - "renderOrder" : 8, - "scale" : 0.2833150625228882 - }, - - { - "aspectScale" : 1, - "body" : 19, - "center" : - { - "x" : 0.0007003694772720337, - "y" : 0.001779437065124512 - }, - "file" : "../../img/Characters/Chuck/lowerLeftArm.png", - "filter" : 0, - "flip" : false, - "id" : 21, - "name" : "image3", - "opacity" : 1, - "renderOrder" : 1, - "scale" : 0.2833150625228882 - }, - - { - "aspectScale" : 1, - "body" : 14, - "center" : - { - "x" : 0.003173574805259705, - "y" : -0.001172244548797607 - }, - "file" : "../../img/Characters/Chuck/upperLeftLeg.png", - "filter" : 0, - "flip" : false, - "id" : 22, - "name" : "image6", - "opacity" : 1, - "renderOrder" : 6, - "scale" : 0.4627031385898590 - }, - - { - "aspectScale" : 1, - "body" : 15, - "center" : - { - "x" : -0.02732392773032188, - "y" : 0.02671334147453308 - }, - "file" : "../../img/Characters/Chuck/upperRightLeg.png", - "filter" : 0, - "flip" : false, - "id" : 23, - "name" : "image6", - "opacity" : 1, - "scale" : 0.5183231234550476 - }, - - { - "aspectScale" : 1, - "body" : 13, - "center" : - { - "x" : 0.02911517955362797, - "y" : -0.0009155124425888062 - }, - "file" : "../../img/Characters/Chuck/lowerLeftLeg.png", - "filter" : 0, - "flip" : false, - "id" : 24, - "name" : "image5", - "opacity" : 1, - "scale" : 0.2289662957191467 - } - ], "metajoint" : [ { "anchorA" : { - "x" : 0.07454992830753326, - "y" : 0.5068107843399048 + "x" : -0.0007802955806255341, + "y" : -0.1484908312559128 }, "anchorB" : { - "x" : -0.02141102217137814, - "y" : -0.3435407876968384 + "x" : -0.0007801018655300140, + "y" : 0.08614096790552139 }, - "bodyA" : 21, - "bodyB" : 20, + "bodyA" : 2, + "bodyB" : 6, "collideConnected" : false, "enableLimit" : true, "enableMotor" : false, - "id" : 10, - "lowerLimit" : -1.221730470657349, + "id" : 1, + "lowerLimit" : 0.01745329238474369, "maxMotorTorque" : 1, "motorSpeed" : 0, - "name" : "joint0", + "name" : "joint7", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 0.6981316804885864 + "upperLimit" : 2.268928050994873 }, { "anchorA" : { - "x" : 0.002425247803330421, - "y" : -0.1845821887254715 + "x" : 0.001979876309633255, + "y" : -0.1506856828927994 }, "anchorB" : { - "x" : 0.002425374463200569, - "y" : 0.1026860624551773 + "x" : 0.001979988068342209, + "y" : 0.08382887393236160 }, - "bodyA" : 15, - "bodyB" : 13, + "bodyA" : 3, + "bodyB" : 1, "collideConnected" : false, "enableLimit" : true, "enableMotor" : false, - "id" : 11, - "lowerLimit" : -2.268928050994873, + "id" : 2, + "lowerLimit" : 0.01745329238474369, "maxMotorTorque" : 1, "motorSpeed" : 0, "name" : "joint8", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 0 + "upperLimit" : 2.268928050994873 }, { "anchorA" : { - "x" : -0.1165831685066223, - "y" : 0.3330365419387817 + "x" : 0.0003538504242897034, + "y" : 0.07107692956924438 }, "anchorB" : { - "x" : -2.135336399078369e-05, - "y" : 0.1812803745269775 + "x" : 0.0003536641597747803, + "y" : -0.1459646224975586 }, - "bodyA" : 21, - "bodyB" : 22, + "bodyA" : 7, + "bodyB" : 4, "collideConnected" : false, - "enableLimit" : false, + "enableLimit" : true, "enableMotor" : false, - "id" : 12, - "lowerLimit" : -2.268928050994873, + "id" : 3, + "lowerLimit" : -1.919862151145935, "maxMotorTorque" : 1, "motorSpeed" : 0, - "name" : "joint3", + "name" : "joint1", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 3.141592741012573 + "upperLimit" : 0.01745329238474369 }, { "anchorA" : { - "x" : 0.1710196435451508, - "y" : 0.3308988809585571 + "x" : 0.1396137326955795, + "y" : 0.2701327204704285 }, "anchorB" : { - "x" : -9.131431579589844e-05, - "y" : 0.1791421175003052 + "x" : -7.455050945281982e-05, + "y" : 0.1462445855140686 }, - "bodyA" : 21, - "bodyB" : 16, + "bodyA" : 9, + "bodyB" : 4, "collideConnected" : false, "enableLimit" : false, "enableMotor" : false, - "id" : 13, + "id" : 4, "lowerLimit" : -2.268928050994873, "maxMotorTorque" : 1, "motorSpeed" : 0, @@ -1031,24 +733,24 @@ { "anchorA" : { - "x" : 0.0004334598779678345, - "y" : 0.08706557750701904 + "x" : -0.06799929589033127, + "y" : -0.2890855073928833 }, "anchorB" : { - "x" : 0.0004332214593887329, - "y" : -0.1787990331649780 + "x" : -0.04493143782019615, + "y" : 0.1559127867221832 }, - "bodyA" : 19, - "bodyB" : 16, + "bodyA" : 9, + "bodyB" : 2, "collideConnected" : false, "enableLimit" : true, "enableMotor" : false, - "id" : 14, - "lowerLimit" : 0, + "id" : 5, + "lowerLimit" : -0.6981316804885864, "maxMotorTorque" : 1, "motorSpeed" : 0, - "name" : "joint1", + "name" : "joint6", "referenceAngle" : 0, "type" : "revolute", "upperLimit" : 1.919862151145935 @@ -1057,20 +759,20 @@ { "anchorA" : { - "x" : 0.1367489844560623, - "y" : -0.3606387376785278 + "x" : 0.1116365119814873, + "y" : -0.2944114208221436 }, "anchorB" : { - "x" : 0.05056379735469818, - "y" : 0.1842886805534363 + "x" : 0.04127831012010574, + "y" : 0.1504460573196411 }, - "bodyA" : 21, - "bodyB" : 15, + "bodyA" : 9, + "bodyB" : 3, "collideConnected" : false, "enableLimit" : true, "enableMotor" : false, - "id" : 15, + "id" : 6, "lowerLimit" : -0.6981316804885864, "maxMotorTorque" : 1, "motorSpeed" : 0, @@ -1083,79 +785,79 @@ { "anchorA" : { - "x" : 0.001047849655151367, - "y" : -0.1790249347686768 + "x" : -0.09517394006252289, + "y" : 0.2718779444694519 }, "anchorB" : { - "x" : 0.001048207283020020, - "y" : 0.08683943748474121 + "x" : -1.741945743560791e-05, + "y" : 0.1479902863502502 }, - "bodyA" : 22, - "bodyB" : 17, + "bodyA" : 9, + "bodyB" : 10, + "collideConnected" : false, + "enableLimit" : false, + "enableMotor" : false, + "id" : 8, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint3", + "referenceAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : 0.0008554458618164062, + "y" : -0.1461489200592041 + }, + "anchorB" : + { + "x" : 0.0008557140827178955, + "y" : 0.07089227437973022 + }, + "bodyA" : 10, + "bodyB" : 5, "collideConnected" : false, "enableLimit" : true, "enableMotor" : false, - "id" : 16, - "lowerLimit" : 0, + "id" : 9, + "lowerLimit" : -1.919862151145935, "maxMotorTorque" : 1, "motorSpeed" : 0, "name" : "joint4", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 1.919862151145935 + "upperLimit" : 0.01745329238474369 }, { "anchorA" : { - "x" : -0.0009558200836181641, - "y" : -0.1818936169147491 + "x" : 0.06392270326614380, + "y" : 0.4330990016460419 }, "anchorB" : { - "x" : -0.0009555891156196594, - "y" : 0.1055182516574860 + "x" : 0.01330260001122952, + "y" : -0.2468920052051544 }, - "bodyA" : 14, - "bodyB" : 18, + "bodyA" : 9, + "bodyB" : 8, "collideConnected" : false, "enableLimit" : true, "enableMotor" : false, - "id" : 17, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint7", - "referenceAngle" : 0, - "type" : "revolute", - "upperLimit" : 0 - }, - - { - "anchorA" : - { - "x" : -0.08329562842845917, - "y" : -0.3541148304939270 - }, - "anchorB" : - { - "x" : -0.0550386831164360, - "y" : 0.1909851431846619 - }, - "bodyA" : 21, - "bodyB" : 14, - "collideConnected" : false, - "enableLimit" : true, - "enableMotor" : false, - "id" : 18, + "id" : 29, "lowerLimit" : -0.6981316804885864, - "maxMotorTorque" : 1, + "maxMotorTorque" : 0, "motorSpeed" : 0, - "name" : "joint6", + "name" : "joint9", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 1.919862151145935 + "upperLimit" : 1.221730470657349 } ], "positionIterations" : 3, diff --git a/static/maps/tiled/debug.json b/static/maps/tiled/debug.json index d8e0842..920a287 100644 --- a/static/maps/tiled/debug.json +++ b/static/maps/tiled/debug.json @@ -108,8 +108,8 @@ "type":"", "visible":true, "width":0, - "x":516.282764098491, - "y":128.219675479405 + "x":548.282764098491, + "y":130.219675479405 }, { "ellipse":true, @@ -215,17 +215,17 @@ { "height":0, "id":10, - "name":"Rube", + "name":"RubeDoll", "properties": { }, "rotation":0, - "type":"rube", + "type":"", "visible":true, "width":0, - "x":236.607333333333, - "y":462.255333333333 + "x":504.607333333333, + "y":111.255333333333 }, { "height":0, From bd7edc779ec15d8c63332c554ad6397e9cdaae49 Mon Sep 17 00:00:00 2001 From: logsol Date: Thu, 23 Apr 2015 19:06:33 +0200 Subject: [PATCH 06/68] removed the piano for our test session --- static/maps/tiled/debug.json | 19 ++----------------- static/maps/tiled/residence.json | 15 --------------- 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/static/maps/tiled/debug.json b/static/maps/tiled/debug.json index a58c9ef..ae3b19d 100644 --- a/static/maps/tiled/debug.json +++ b/static/maps/tiled/debug.json @@ -60,8 +60,8 @@ "type":"", "visible":true, "width":0, - "x":222.535368857004, - "y":170.525492560429 + "x":247.535368857004, + "y":177.525492560429 }, { "ellipse":true, @@ -286,21 +286,6 @@ "width":0, "x":464, "y":357 - }, - { - "height":0, - "id":15, - "name":"Piano", - "properties": - { - - }, - "rotation":0, - "type":"", - "visible":true, - "width":0, - "x":206, - "y":183 }], "opacity":1, "type":"objectgroup", diff --git a/static/maps/tiled/residence.json b/static/maps/tiled/residence.json index bcae4e0..61b791f 100644 --- a/static/maps/tiled/residence.json +++ b/static/maps/tiled/residence.json @@ -302,21 +302,6 @@ "x":1635, "y":789 }, - { - "height":0, - "id":192, - "name":"Piano", - "properties": - { - - }, - "rotation":0, - "type":"", - "visible":true, - "width":0, - "x":1584, - "y":942 - }, { "height":0, "id":194, From c4fcb2fabfcc211008f7b00afba0f21a9cd8193b Mon Sep 17 00:00:00 2001 From: logsol Date: Tue, 28 Apr 2015 14:56:29 +0200 Subject: [PATCH 07/68] fixed a few bugs - rube loader was manipulating the json, which resulted in coordinates flipping every second time --- app/Lib/Vendor/RubeLoader.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Lib/Vendor/RubeLoader.js b/app/Lib/Vendor/RubeLoader.js index 49674c3..2b6d5a1 100644 --- a/app/Lib/Vendor/RubeLoader.js +++ b/app/Lib/Vendor/RubeLoader.js @@ -152,8 +152,7 @@ function (Box2D) { if ( bodyJson.hasOwnProperty('linearVelocity') && bodyJson.linearVelocity instanceof Object ) bd.linearVelocity.SetV( bodyJson.linearVelocity ); if ( bodyJson.hasOwnProperty('position') && bodyJson.position instanceof Object ) - bodyJson.position.y *= -1; - bd.position.SetV( bodyJson.position ); + bd.position.SetV( this.getVectorValue(bodyJson.position) ); if ( bodyJson.hasOwnProperty('awake') ) bd.awake = bodyJson.awake; else @@ -169,6 +168,7 @@ function (Box2D) { body.name = bodyJson.name; if ( bodyJson.hasOwnProperty('customProperties') ) body.customProperties = bodyJson.customProperties; + return body; } @@ -231,8 +231,7 @@ function (Box2D) { RubeLoader.prototype.getVectorValue = function (val) { if ( val instanceof Object ) { - val.y *= -1; - return val; + return { x: val.x, y: val.y * -1 }; } else { return { x:0, y:0 }; } From b3fbf34cf72e97366e5ce21baa76266ea99af2a6 Mon Sep 17 00:00:00 2001 From: logsol Date: Tue, 28 Apr 2015 14:57:22 +0200 Subject: [PATCH 08/68] implemented rube doll to appear when dying --- .../Channel/GameObjects/Items/RubeDoll.js | 42 +++++++++++++++++-- app/Game/Client/GameObjects/Items/RubeDoll.js | 8 +++- app/Game/Client/Player.js | 4 -- app/Game/Core/GameObjects/Items/RubeDoll.js | 41 +++++++++++++++++- app/Game/Core/Player.js | 18 ++++++-- 5 files changed, 99 insertions(+), 14 deletions(-) diff --git a/app/Game/Channel/GameObjects/Items/RubeDoll.js b/app/Game/Channel/GameObjects/Items/RubeDoll.js index 3e27b2b..b810471 100644 --- a/app/Game/Channel/GameObjects/Items/RubeDoll.js +++ b/app/Game/Channel/GameObjects/Items/RubeDoll.js @@ -1,11 +1,45 @@ define([ - "Game/Core/GameObjects/Items/RubeDoll" + "Game/Core/GameObjects/Items/RubeDoll", + "Game/Config/Settings", + "Lib/Utilities/NotificationCenter" ], -function (Parent) { +function (Parent, Settings, Nc) { - "use strict"; + "use strict"; + + function RubeDoll(physicsEngine, uid, options) { + Parent.call(this, physicsEngine, uid, options); + } - return Parent; + RubeDoll.prototype = Object.create(Parent.prototype); + + RubeDoll.prototype.beingReleased = function(player) { + Parent.prototype.beingReleased.call(this, player); + if(this.scheduledForDestruction) { + this.delayedDestroy(); + } + }; + + RubeDoll.prototype.delayedDestroy = function() { + var self = this; + this.scheduledForDestruction = true; + this.destructionTimeout = setTimeout(function() { + Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, 'removeGameObject', { + type: 'animated', + uid: self.uid + }); + self.destroy(); + }, Settings.RAGDOLL_DESTRUCTION_TIME * 1000); + }; + + RubeDoll.prototype.destroy = function() { + if(this.scheduledForDestruction) { + clearTimeout(this.destructionTimeout); + } + Parent.prototype.destroy.call(this); + }; + + return RubeDoll; }); \ No newline at end of file diff --git a/app/Game/Client/GameObjects/Items/RubeDoll.js b/app/Game/Client/GameObjects/Items/RubeDoll.js index 2c76d91..078fd9a 100644 --- a/app/Game/Client/GameObjects/Items/RubeDoll.js +++ b/app/Game/Client/GameObjects/Items/RubeDoll.js @@ -11,7 +11,7 @@ function (Parent, Layer, Settings, Nc) { function RubeDoll(physicsEngine, uid, options) { - this.primaryColor = 0x008800; + this.primaryColor = options.primaryColor; var limbOptions = {}; @@ -160,6 +160,12 @@ function (Parent, Layer, Settings, Nc) { }; RubeDoll.prototype.destroy = function() { + + for (var name in this.limbMeshes) { + Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, this.limbMeshes[name]); + }; + + Parent.prototype.destroy.call(this); }; RubeDoll.prototype.render = function() { diff --git a/app/Game/Client/Player.js b/app/Game/Client/Player.js index 5170f63..cb7c9db 100755 --- a/app/Game/Client/Player.js +++ b/app/Game/Client/Player.js @@ -83,10 +83,6 @@ function (Parent, Nc, Settings) { } }; - Player.prototype.getNickname = function() { - return this.user.options.nickname; - }; - Player.prototype.render = function() { if(this.doll) { diff --git a/app/Game/Core/GameObjects/Items/RubeDoll.js b/app/Game/Core/GameObjects/Items/RubeDoll.js index ad3323e..ea5b6c0 100644 --- a/app/Game/Core/GameObjects/Items/RubeDoll.js +++ b/app/Game/Core/GameObjects/Items/RubeDoll.js @@ -4,10 +4,11 @@ define([ "Lib/Vendor/Box2D", "Game/Config/Settings", "Lib/Utilities/Assert", + "Lib/Utilities/NotificationCenter", "json!Game/Asset/RubeDoll.json" // using requirejs json loader plugin ], -function (Parent, RubeLoader, Box2D, Settings, Assert, RubeDollJson) { +function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { "use strict"; @@ -45,6 +46,13 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, RubeDollJson) { RubeDoll.prototype = Object.create(Parent.prototype); + RubeDoll.prototype.getFixtureDef = function() { + + var fixtureDef = new Box2D.Dynamics.b2FixtureDef(); + fixtureDef.shape = new Box2D.Collision.Shapes.b2CircleShape(); + return fixtureDef; + }; + RubeDoll.prototype.flip = function(direction) { Parent.prototype.flip.call(this, direction); // Extend @@ -61,6 +69,37 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, RubeDollJson) { this.body.SetPosition(position); }; + + RubeDoll.prototype.setVelocities = function(options) { + Assert.number(options.linearVelocity.x, options.linearVelocity.y); + Assert.number(options.angularVelocity); + + this.body.SetLinearVelocity(options.linearVelocity); + this.body.SetAngularVelocity(options.angularVelocity); + for(var name in this.limbs) { + this.limbs[name].SetLinearVelocity(options.linearVelocity); + } + }; + + RubeDoll.prototype.getPosition = function() { + return this.body.GetPosition().Copy(); + }; + + RubeDoll.prototype.getHeadPosition = function() { + return this.limbs.head.GetPosition().Copy(); + }; + + RubeDoll.prototype.destroy = function() { + + Nc.trigger(Nc.ns.core.game.gameObject.remove, "animated", this); + var world = this.body.GetWorld(); + + for (var name in this.limbs) { + world.DestroyBody(this.limbs[name]); + } + + Parent.prototype.destroy.call(this); + }; return RubeDoll; }); \ No newline at end of file diff --git a/app/Game/Core/Player.js b/app/Game/Core/Player.js index e9a818a..67b492b 100755 --- a/app/Game/Core/Player.js +++ b/app/Game/Core/Player.js @@ -3,11 +3,12 @@ define([ "Game/Config/Settings", "Lib/Utilities/NotificationCenter", "Lib/Utilities/Exception", + "Lib/Utilities/ColorConverter", "Game/" + GLOBALS.context + "/GameObjects/SpectatorDoll", - "Game/" + GLOBALS.context + "/GameObjects/Items/RagDoll" + "Game/" + GLOBALS.context + "/GameObjects/Items/RubeDoll" ], -function (Doll, Settings, Nc, Exception, SpectatorDoll, RagDoll) { +function (Doll, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll) { "use strict"; @@ -30,6 +31,10 @@ function (Doll, Settings, Nc, Exception, SpectatorDoll, RagDoll) { Nc.trigger(Nc.ns.core.game.gameObject.add, 'animated', this); } + Player.prototype.getNickname = function() { + return this.user.options.nickname; + }; + Player.prototype.getActiveDoll = function() { if(this.spawned) { return this.doll; @@ -112,6 +117,10 @@ function (Doll, Settings, Nc, Exception, SpectatorDoll, RagDoll) { } // prepare for creating the ragdoll + + var converter = new ColorConverter(); + var primaryColor = converter.getColorByName(this.getNickname()); + var options = { x: this.getPosition().x * Settings.RATIO, y: this.getPosition().y * Settings.RATIO, @@ -123,10 +132,11 @@ function (Doll, Settings, Nc, Exception, SpectatorDoll, RagDoll) { type: "ragdoll", weight: 3, width: 5, - height: 12 + height: 12, + primaryColor: primaryColor }; - var ragDoll = new RagDoll(this.physicsEngine, "ragDoll-" + this.id + "-" + ragDollId, options); + var ragDoll = new RubeDoll(this.physicsEngine, "ragDoll-" + this.id + "-" + ragDollId, options); ragDoll.setVelocities(this.doll.getVelocities()); this.spawned = false; From 0da744f5fd7cc1cb64b8fc0adb1e044c372f7595 Mon Sep 17 00:00:00 2001 From: logsol Date: Tue, 28 Apr 2015 15:50:45 +0200 Subject: [PATCH 09/68] changed box2d calculation config #158 --- app/Game/Config/Settings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Game/Config/Settings.js b/app/Game/Config/Settings.js index 993e3e4..4e93113 100755 --- a/app/Game/Config/Settings.js +++ b/app/Game/Config/Settings.js @@ -16,8 +16,8 @@ function () { BOX2D_WORLD_AABB_SIZE: 3000, BOX2D_ALLOW_SLEEP: true, BOX2D_GRAVITY: 26, - BOX2D_VELOCITY_ITERATIONS: 5, - BOX2D_POSITION_ITERATIONS: 5, + BOX2D_VELOCITY_ITERATIONS: 10, + BOX2D_POSITION_ITERATIONS: 6, BOX2D_TIME_STEP: 1 / 60, // PATHS From a5f45ffef695defc94302742a8ac7b833d8acedb Mon Sep 17 00:00:00 2001 From: logsol Date: Wed, 29 Apr 2015 00:04:17 +0200 Subject: [PATCH 10/68] implemented rubedoll direction flip and added meshIndex (z) swapping capability. #151 --- app/Game/Asset/RubeDoll.json | 666 +++++++++--------- app/Game/Channel/GameController.js | 6 +- .../Channel/GameObjects/Items/RubeDoll.js | 10 + app/Game/Client/GameObjects/Items/RubeDoll.js | 46 +- app/Game/Client/View/LayerManager.js | 8 +- app/Game/Client/View/Pixi/Layer.js | 8 + app/Game/Core/GameObjects/Doll.js | 2 +- app/Game/Core/GameObjects/Items/RubeDoll.js | 58 +- app/Game/Core/Player.js | 11 +- app/Lib/Utilities/NotificationCenter.js | 3 +- app/Lib/Vendor/RubeLoader.js | 2 +- static/items/rube/ragdoll.rube | 52 +- 12 files changed, 483 insertions(+), 389 deletions(-) diff --git a/app/Game/Asset/RubeDoll.json b/app/Game/Asset/RubeDoll.json index 114e29f..37e4c0e 100644 --- a/app/Game/Asset/RubeDoll.json +++ b/app/Game/Asset/RubeDoll.json @@ -5,6 +5,57 @@ "body" : [ + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture2", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.1570904254913330, + 0.1570904254913330, + -0.1156365871429443, + -0.1156365871429443 + ], + "y" : + [ + -0.3584164977073669, + 0.4034895300865173, + 0.4034895300865173, + -0.3584164977073669 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.01153474207967520, + "massData-center" : + { + "x" : 0.02072691917419434, + "y" : 0.02253651618957520 + }, + "massData-mass" : 0.2077923566102982, + "name" : "chest", + "position" : + { + "x" : -0.04104747623205185, + "y" : 0.7829875946044922 + }, + "type" : 2 + }, + { "angle" : 0, "angularVelocity" : 0, @@ -67,86 +118,42 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "name" : "fixture0", + "name" : "fixture3", "polygon" : { "vertices" : { "x" : [ - 0.1402979493141174, - 0.1375417709350586, - 0.001378186047077179, - -0.1402979493141174, - -0.1402979493141174, - 0.001192390918731689 + 0.07039496302604675, + 0.07039496302604675, + -0.07039486616849899, + -0.07039486616849899 ], "y" : [ - -0.3207050263881683, - 0.4018019437789917, - 0.4018019437789917, - 0.3136067390441895, - -0.3432337343692780, - -0.3689299821853638 + -0.09294389933347702, + 0.1276105940341949, + 0.1276105940341949, + -0.09294389933347702 ] } } } ], "linearVelocity" : 0, - "massData-I" : 0.01047351956367493, + "massData-I" : 0.0001864957448560745, "massData-center" : { - "x" : 0.001456731930375099, - "y" : 0.01425695233047009 + "x" : 4.842877032729120e-08, + "y" : 0.01733334921300411 }, - "massData-mass" : 0.2038488984107971, - "name" : "chest", + "massData-mass" : 0.03105182945728302, + "name" : "lowerRightLeg", "position" : { - "x" : -0.04104747623205185, - "y" : 0.7829875946044922 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "circle" : - { - "center" : - { - "x" : -0.002679032273590565, - "y" : 0.004700660705566406 - }, - "radius" : 0.2268356680870056 - }, - "density" : 0.2204959988594055, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture1" - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0009180362685583532, - "massData-center" : - { - "x" : -0.002679032273590565, - "y" : 0.004700660705566406 - }, - "massData-mass" : 0.03564291819930077, - "name" : "head", - "position" : - { - "x" : 0.009572610259056091, - "y" : 1.462979435920715 + "x" : 0.02818956598639488, + "y" : 0.1036150008440018 }, "type" : 2 }, @@ -169,35 +176,35 @@ { "x" : [ - 0.04693000018596649, - 0.04693000018596649, - -0.04693005979061127, - -0.04693005979061127 + 0.07039505988359451, + 0.07039505988359451, + -0.07039495557546616, + -0.07039495557546616 ], "y" : [ - -0.1159216761589050, - 0.1159217953681946, - 0.1159217953681946, - -0.1159216761589050 + -0.1890522241592407, + 0.1890524625778198, + 0.1890524625778198, + -0.1890522241592407 ] } } } ], "linearVelocity" : 0, - "massData-I" : 0.0001134485355578363, + "massData-I" : 0.000722132739610970, "massData-center" : { - "x" : -2.980232238769531e-08, - "y" : 5.960464477539062e-08 + "x" : 5.215406417846680e-08, + "y" : 1.192092824453539e-07 }, - "massData-mass" : 0.02176084183156490, - "name" : "lowerRightArm", + "massData-mass" : 0.05323336645960808, + "name" : "upperLeftLeg", "position" : { - "x" : 0.09864036738872528, - "y" : 0.6898344159126282 + "x" : -0.06537666171789169, + "y" : 0.3381301760673523 }, "type" : 2 }, @@ -304,57 +311,6 @@ "type" : 2 }, - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.04693000018596649, - 0.04693000018596649, - -0.04693005979061127, - -0.04693005979061127 - ], - "y" : - [ - -0.1895973682403564, - 0.1895966529846191, - 0.1895966529846191, - -0.1895973682403564 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0004525946278590709, - "massData-center" : - { - "x" : -2.980232238769531e-08, - "y" : -3.576278686523438e-07 - }, - "massData-mass" : 0.03559117391705513, - "name" : "upperRightArm", - "position" : - { - "x" : 0.09864036738872528, - "y" : 0.9068759679794312 - }, - "type" : 2 - }, - { "angle" : 0, "angularVelocity" : 0, @@ -424,35 +380,35 @@ { "x" : [ - 0.07039505988359451, - 0.07039505988359451, - -0.07039495557546616, - -0.07039495557546616 + 0.04693000018596649, + 0.04693000018596649, + -0.04693005979061127, + -0.04693005979061127 ], "y" : [ - -0.1890522241592407, - 0.1890524625778198, - 0.1890524625778198, - -0.1890522241592407 + -0.1895973682403564, + 0.1895966529846191, + 0.1895966529846191, + -0.1895973682403564 ] } } } ], "linearVelocity" : 0, - "massData-I" : 0.000722132739610970, + "massData-I" : 0.0004525946278590709, "massData-center" : { - "x" : 5.215406417846680e-08, - "y" : 1.192092824453539e-07 + "x" : -2.980232238769531e-08, + "y" : -3.576278686523438e-07 }, - "massData-mass" : 0.05323336645960808, - "name" : "upperLeftLeg", + "massData-mass" : 0.03559117391705513, + "name" : "upperRightArm", "position" : { - "x" : -0.06537666171789169, - "y" : 0.3381301760673523 + "x" : 0.09864036738872528, + "y" : 0.9068759679794312 }, "type" : 2 }, @@ -475,35 +431,75 @@ { "x" : [ - 0.07039496302604675, - 0.07039496302604675, - -0.07039486616849899, - -0.07039486616849899 + 0.04693000018596649, + 0.04693000018596649, + -0.04693005979061127, + -0.04693005979061127 ], "y" : [ - -0.09294389933347702, - 0.1276105940341949, - 0.1276105940341949, - -0.09294389933347702 + -0.1159216761589050, + 0.1159217953681946, + 0.1159217953681946, + -0.1159216761589050 ] } } } ], "linearVelocity" : 0, - "massData-I" : 0.0001864957448560745, + "massData-I" : 0.0001134485355578363, "massData-center" : { - "x" : 4.842877032729120e-08, - "y" : 0.01733334921300411 + "x" : -2.980232238769531e-08, + "y" : 5.960464477539062e-08 }, - "massData-mass" : 0.03105182945728302, - "name" : "lowerRightLeg", + "massData-mass" : 0.02176084183156490, + "name" : "lowerRightArm", "position" : { - "x" : 0.02818956598639488, - "y" : 0.1036150008440018 + "x" : 0.09864036738872528, + "y" : 0.6898344159126282 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "circle" : + { + "center" : + { + "x" : -0.01561669446527958, + "y" : 0.004700659774243832 + }, + "radius" : 0.2268356680870056 + }, + "density" : 0.2204959988594055, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture1" + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0009264730615541339, + "massData-center" : + { + "x" : -0.01561669446527958, + "y" : 0.004700659774243832 + }, + "massData-mass" : 0.03564291819930077, + "name" : "head", + "position" : + { + "x" : 0.009572610259056091, + "y" : 1.462979435920715 }, "type" : 2 } @@ -555,181 +551,6 @@ "joint" : [ - { - "anchorA" : - { - "x" : 0.06392270326614380, - "y" : 0.4330990314483643 - }, - "anchorB" : - { - "x" : 0.01330260001122952, - "y" : -0.2468919754028320 - }, - "bodyA" : 1, - "bodyB" : 2, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -0.6981316804885864, - "maxMotorTorque" : 0, - "motorSpeed" : 0, - "name" : "joint9", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 1.221730470657349 - }, - - { - "anchorA" : - { - "x" : 0.0008554458618164062, - "y" : -0.1461489200592041 - }, - "anchorB" : - { - "x" : 0.0008557140827178955, - "y" : 0.07089227437973022 - }, - "bodyA" : 0, - "bodyB" : 5, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -1.919862151145935, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint4", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 0.01745329238474369 - }, - - { - "anchorA" : - { - "x" : 0.0003538504242897034, - "y" : 0.07107692956924438 - }, - "anchorB" : - { - "x" : 0.0003536641597747803, - "y" : -0.1459646224975586 - }, - "bodyA" : 3, - "bodyB" : 6, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -1.919862151145935, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint1", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 0.01745329238474369 - }, - - { - "anchorA" : - { - "x" : 0.001979876309633255, - "y" : -0.1506856828927994 - }, - "anchorB" : - { - "x" : 0.001979988068342209, - "y" : 0.08382888138294220 - }, - "bodyA" : 7, - "bodyB" : 9, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : 0.01745329238474369, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint8", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 2.268928050994873 - }, - - { - "anchorA" : - { - "x" : -0.0007802918553352356, - "y" : -0.1484908312559128 - }, - "anchorB" : - { - "x" : -0.0007800981402397156, - "y" : 0.08614097535610199 - }, - "bodyA" : 8, - "bodyB" : 4, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : 0.01745329238474369, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint7", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 2.268928050994873 - }, - - { - "anchorA" : - { - "x" : -0.09517393261194229, - "y" : 0.2718780040740967 - }, - "anchorB" : - { - "x" : -1.741945743560791e-05, - "y" : 0.1479903459548950 - }, - "bodyA" : 1, - "bodyB" : 0, - "enableLimit" : false, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint3", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 3.141592741012573 - }, - - { - "anchorA" : - { - "x" : 0.1396137326955795, - "y" : 0.2701327800750732 - }, - "anchorB" : - { - "x" : -7.455050945281982e-05, - "y" : 0.1462446451187134 - }, - "bodyA" : 1, - "bodyB" : 6, - "enableLimit" : false, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint2", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 3.141592741012573 - }, - { "anchorA" : { @@ -741,8 +562,8 @@ "x" : -0.04493143409490585, "y" : 0.1559127867221832 }, - "bodyA" : 1, - "bodyB" : 8, + "bodyA" : 0, + "bodyB" : 3, "enableLimit" : true, "enableMotor" : false, "jointSpeed" : 0, @@ -766,8 +587,8 @@ "x" : 0.04127830639481544, "y" : 0.1504460573196411 }, - "bodyA" : 1, - "bodyB" : 7, + "bodyA" : 0, + "bodyB" : 6, "enableLimit" : true, "enableMotor" : false, "jointSpeed" : 0, @@ -778,6 +599,181 @@ "refAngle" : 0, "type" : "revolute", "upperLimit" : 1.919862151145935 + }, + + { + "anchorA" : + { + "x" : -0.0007802918553352356, + "y" : -0.1484908312559128 + }, + "anchorB" : + { + "x" : -0.0007800981402397156, + "y" : 0.08614097535610199 + }, + "bodyA" : 3, + "bodyB" : 4, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0.01745329238474369, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint7", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 2.268928050994873 + }, + + { + "anchorA" : + { + "x" : 0.001979876309633255, + "y" : -0.1506856828927994 + }, + "anchorB" : + { + "x" : 0.001979988068342209, + "y" : 0.08382888138294220 + }, + "bodyA" : 6, + "bodyB" : 2, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0.01745329238474369, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint8", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 2.268928050994873 + }, + + { + "anchorA" : + { + "x" : 0.0003538504242897034, + "y" : 0.07107692956924438 + }, + "anchorB" : + { + "x" : 0.0003536641597747803, + "y" : -0.1459646224975586 + }, + "bodyA" : 8, + "bodyB" : 7, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -1.919862151145935, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint1", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 0 + }, + + { + "anchorA" : + { + "x" : 0.06392270326614380, + "y" : 0.4330990314483643 + }, + "anchorB" : + { + "x" : 0.01330260001122952, + "y" : -0.2468919754028320 + }, + "bodyA" : 0, + "bodyB" : 9, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.6981316804885864, + "maxMotorTorque" : 0, + "motorSpeed" : 0, + "name" : "joint9", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.221730470657349 + }, + + { + "anchorA" : + { + "x" : 0.1396137326955795, + "y" : 0.2701327800750732 + }, + "anchorB" : + { + "x" : -7.455050945281982e-05, + "y" : 0.1462446451187134 + }, + "bodyA" : 0, + "bodyB" : 7, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint2", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : -0.09517393261194229, + "y" : 0.2718780040740967 + }, + "anchorB" : + { + "x" : -1.741945743560791e-05, + "y" : 0.1479903459548950 + }, + "bodyA" : 0, + "bodyB" : 1, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint3", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : 0.0008554458618164062, + "y" : -0.1461489200592041 + }, + "anchorB" : + { + "x" : 0.0008557140827178955, + "y" : 0.07089227437973022 + }, + "bodyA" : 1, + "bodyB" : 5, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -1.919862151145935, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint4", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 0.01745329238474369 } ], "positionIterations" : 3, diff --git a/app/Game/Channel/GameController.js b/app/Game/Channel/GameController.js index 571b088..6b3b1db 100755 --- a/app/Game/Channel/GameController.js +++ b/app/Game/Channel/GameController.js @@ -9,10 +9,10 @@ define([ "Game/Channel/Player", "Game/Channel/GameObjects/GameObject", "Game/Channel/GameObjects/Doll", - "Game/Channel/GameObjects/Items/RagDoll" + "Game/Channel/GameObjects/Items/RubeDoll" ], -function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, Nc, Box2D, Player, GameObject, Doll, RagDoll) { +function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, Nc, Box2D, Player, GameObject, Doll, RubeDoll) { "use strict"; @@ -172,7 +172,7 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N var objects = []; for (var i = 0; i < this.gameObjects.animated.length; i++) { - if(this.gameObjects.animated[i] instanceof RagDoll) { + if(this.gameObjects.animated[i] instanceof RubeDoll) { var object = this.gameObjects.animated[i]; var options = object.options; options.x = object.getPosition().x; diff --git a/app/Game/Channel/GameObjects/Items/RubeDoll.js b/app/Game/Channel/GameObjects/Items/RubeDoll.js index b810471..dfad73f 100644 --- a/app/Game/Channel/GameObjects/Items/RubeDoll.js +++ b/app/Game/Channel/GameObjects/Items/RubeDoll.js @@ -9,10 +9,20 @@ function (Parent, Settings, Nc) { "use strict"; function RubeDoll(physicsEngine, uid, options) { + this.scheduledForDestruction = false; + this.destructionTimeout = null; + Parent.call(this, physicsEngine, uid, options); } RubeDoll.prototype = Object.create(Parent.prototype); + + RubeDoll.prototype.beingGrabbed = function(player) { + Parent.prototype.beingGrabbed.call(this, player); + if(this.scheduledForDestruction) { + clearTimeout(this.destructionTimeout); + } + }; RubeDoll.prototype.beingReleased = function(player) { Parent.prototype.beingReleased.call(this, player); diff --git a/app/Game/Client/GameObjects/Items/RubeDoll.js b/app/Game/Client/GameObjects/Items/RubeDoll.js index 078fd9a..4075560 100644 --- a/app/Game/Client/GameObjects/Items/RubeDoll.js +++ b/app/Game/Client/GameObjects/Items/RubeDoll.js @@ -93,6 +93,7 @@ function (Parent, Layer, Settings, Nc) { this.limbMeshes = {}; this.baseMeshName = "chest"; this.characterName = "Chuck"; + this.lastFlipDirection = 1; Parent.call(this, physicsEngine, uid, options); } @@ -101,10 +102,8 @@ function (Parent, Layer, Settings, Nc) { RubeDoll.prototype.createMesh = function() { - this.createLimbMesh("lowerRightLeg"); this.createLimbMesh("upperRightLeg"); - this.createLimbMesh("lowerRightArm"); this.createLimbMesh("upperRightArm"); @@ -113,7 +112,6 @@ function (Parent, Layer, Settings, Nc) { this.createLimbMesh("lowerLeftLeg"); this.createLimbMesh("upperLeftLeg"); - this.createLimbMesh("lowerLeftArm"); this.createLimbMesh("upperLeftArm"); @@ -187,6 +185,48 @@ function (Parent, Layer, Settings, Nc) { }; RubeDoll.prototype.flip = function(direction) { + Parent.prototype.flip.call(this, direction); + + if(this.limbs) { + for(var name in this.limbMeshes) { + if(this.limbs[name]) { + Nc.trigger(Nc.ns.client.view.mesh.update, + this.layerId, + this.limbMeshes[name], + { + xScale: direction, + } + ); + } + } + } + + // flipping depth of right body side arm/leg images with left + if (this.lastFlipDirection != direction) { + + this.lastFlipDirection = direction; + + Nc.trigger(Nc.ns.client.view.mesh.swapMeshIndexes, + this.layerId, + this.limbMeshes["lowerRightLeg"], + this.limbMeshes["lowerLeftLeg"] + ); + Nc.trigger(Nc.ns.client.view.mesh.swapMeshIndexes, + this.layerId, + this.limbMeshes["upperRightLeg"], + this.limbMeshes["upperLeftLeg"] + ); + Nc.trigger(Nc.ns.client.view.mesh.swapMeshIndexes, + this.layerId, + this.limbMeshes["lowerRightArm"], + this.limbMeshes["lowerLeftArm"] + ); + Nc.trigger(Nc.ns.client.view.mesh.swapMeshIndexes, + this.layerId, + this.limbMeshes["upperRightArm"], + this.limbMeshes["upperLeftArm"] + ); + } }; return RubeDoll; diff --git a/app/Game/Client/View/LayerManager.js b/app/Game/Client/View/LayerManager.js index 3ad6dea..7adec2f 100644 --- a/app/Game/Client/View/LayerManager.js +++ b/app/Game/Client/View/LayerManager.js @@ -20,7 +20,8 @@ function (Nc, Exception, Layer) { Nc.on(Nc.ns.client.view.mesh.remove, this.removeMesh, this), Nc.on(Nc.ns.client.view.mesh.update, this.updateMesh, this), Nc.on(Nc.ns.client.view.mesh.addFilter, this.addFilter, this), - Nc.on(Nc.ns.client.view.mesh.removeFilter, this.removeFilter, this) + Nc.on(Nc.ns.client.view.mesh.removeFilter, this.removeFilter, this), + Nc.on(Nc.ns.client.view.mesh.swapMeshIndexes, this.swapMeshIndexes, this) ]; } @@ -157,6 +158,11 @@ function (Nc, Exception, Layer) { this.delegate.apply(this, arguments); }; + LayerManager.prototype.swapMeshIndexes = function() { + Array.prototype.splice.call(arguments, 0, 0, 'swapMeshIndexes') + this.delegate.apply(this, arguments); + }; + LayerManager.prototype.destroy = function() { for (var i = 0; i < this.ncTokens.length; i++) { Nc.off(this.ncTokens[i]); diff --git a/app/Game/Client/View/Pixi/Layer.js b/app/Game/Client/View/Pixi/Layer.js index acd0f98..58a0fd8 100644 --- a/app/Game/Client/View/Pixi/Layer.js +++ b/app/Game/Client/View/Pixi/Layer.js @@ -95,6 +95,14 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings, ColorConverter, Nc) { this.container.removeChild(mesh); }; + Layer.prototype.swapMeshIndexes = function(meshA, meshB) { + var indexA = this.container.getChildIndex(meshA); + var indexB = this.container.getChildIndex(meshB); + + this.container.setChildIndex(meshA, indexB); + this.container.setChildIndex(meshB, indexA); + }; + Layer.prototype.createMesh = function (texturePath, callback, options) { var texture = (options && options.fromFrame) diff --git a/app/Game/Core/GameObjects/Doll.js b/app/Game/Core/GameObjects/Doll.js index 8090fb8..7dd7780 100755 --- a/app/Game/Core/GameObjects/Doll.js +++ b/app/Game/Core/GameObjects/Doll.js @@ -40,7 +40,7 @@ function (Parent, Exception, Box2D, Settings, CollisionDetector, Item, Nc, Asser this.holdingJoint = null; this.holdingItem = null; - this.ragDoll = {head: null, body: null}; + this.ragDoll = {head: null, body: null}; // FIXME: wtf is this? can we remove it? this.createFixtures(); this.body.SetActive(false); diff --git a/app/Game/Core/GameObjects/Items/RubeDoll.js b/app/Game/Core/GameObjects/Items/RubeDoll.js index ea5b6c0..eeca209 100644 --- a/app/Game/Core/GameObjects/Items/RubeDoll.js +++ b/app/Game/Core/GameObjects/Items/RubeDoll.js @@ -18,10 +18,27 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { this.rubeLoader = null; this.body = null; this.limbs = {}; + this.joints = null; + this.limits = []; var chest = null; var world = physicsEngine.getWorld(); this.rubeLoader = new RubeLoader(RubeDollJson, world); + + this.loadRubeDollFromScene(options); + + Parent.call(this, physicsEngine, uid, options); + world.DestroyBody(this.body); + this.body = this.limbs.chest; + + this.body.SetUserData(this); + + this.flip(options.direction); + } + + RubeDoll.prototype = Object.create(Parent.prototype); + + RubeDoll.prototype.loadRubeDollFromScene = function(options) { var scene = this.rubeLoader.getScene(); for (var i in scene.bodies) { @@ -35,19 +52,17 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { this.limbs[body.name] = body; } - Parent.call(this, physicsEngine, uid, options); - world.DestroyBody(this.body); - this.body = this.limbs.chest; + this.joints = scene.joints; - var def = this.body.GetDefinition(); - def.userData = this; - this.body.SetUserData(this); - } - - RubeDoll.prototype = Object.create(Parent.prototype); + for (var i in this.joints) { + this.limits[i] = { + lower: this.joints[i].GetLowerLimit(), + upper: this.joints[i].GetUpperLimit(), + }; + } + }; RubeDoll.prototype.getFixtureDef = function() { - var fixtureDef = new Box2D.Dynamics.b2FixtureDef(); fixtureDef.shape = new Box2D.Collision.Shapes.b2CircleShape(); return fixtureDef; @@ -55,7 +70,28 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { RubeDoll.prototype.flip = function(direction) { Parent.prototype.flip.call(this, direction); - // Extend + + for (var i in this.joints) { + var joint = this.joints[i]; + var limits = this.limits[i]; + + if (joint instanceof Box2D.Dynamics.Joints.b2RevoluteJoint) { + + if (direction > 0) { + joint.SetLimits(limits.lower, limits.upper); + continue; + } + + var a1 = limits.lower * -1; + var a2 = limits.upper * -1; + + if (a2 > a1) { + joint.SetLimits(a1, a2); + } else { + joint.SetLimits(a2, a1); + } + } + } }; RubeDoll.prototype.reposition = function(handPosition, direction) { diff --git a/app/Game/Core/Player.js b/app/Game/Core/Player.js index 67b492b..d40a748 100755 --- a/app/Game/Core/Player.js +++ b/app/Game/Core/Player.js @@ -129,22 +129,23 @@ function (Doll, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll image: "chest.png", name: "RagDoll", rotation: 0, - type: "ragdoll", + type: "rubedoll", weight: 3, width: 5, height: 12, - primaryColor: primaryColor + primaryColor: primaryColor, + direction: this.doll.lookDirection }; - var ragDoll = new RubeDoll(this.physicsEngine, "ragDoll-" + this.id + "-" + ragDollId, options); - ragDoll.setVelocities(this.doll.getVelocities()); + var rubeDoll = new RubeDoll(this.physicsEngine, "rubeDoll-" + this.id + "-" + ragDollId, options); + rubeDoll.setVelocities(this.doll.getVelocities()); this.spawned = false; this.doll.destroy(); this.doll = null; - this.ragDoll = ragDoll; + this.ragDoll = rubeDoll; }; Player.prototype.update = function () { diff --git a/app/Lib/Utilities/NotificationCenter.js b/app/Lib/Utilities/NotificationCenter.js index 33f8eb7..ec4beb3 100755 --- a/app/Lib/Utilities/NotificationCenter.js +++ b/app/Lib/Utilities/NotificationCenter.js @@ -41,7 +41,8 @@ function (Exception) { remove: null, update: null, addFilter: null, - removeFilter: null + removeFilter: null, + swapMeshIndexes: null }, animatedMesh: { create: null diff --git a/app/Lib/Vendor/RubeLoader.js b/app/Lib/Vendor/RubeLoader.js index 2b6d5a1..b1f3b83 100644 --- a/app/Lib/Vendor/RubeLoader.js +++ b/app/Lib/Vendor/RubeLoader.js @@ -426,7 +426,7 @@ function (Box2D) { var scene = { bodies: loadedBodies, - // joints: loadedJoints + joints: loadedJoints }; return scene; diff --git a/static/items/rube/ragdoll.rube b/static/items/rube/ragdoll.rube index b7f646a..5a3b727 100644 --- a/static/items/rube/ragdoll.rube +++ b/static/items/rube/ragdoll.rube @@ -482,18 +482,18 @@ ], "vertices" : { - "x" : [ -0.002679032273590565 ], - "y" : [ 0.004700660705566406 ] + "x" : [ -0.01561669446527958 ], + "y" : [ 0.004700659774243832 ] } } ], "id" : 8, "linearVelocity" : 0, - "massData-I" : 0.0009180362685583532, + "massData-I" : 0.0009264730615541339, "massData-center" : { - "x" : -0.002679032273590565, - "y" : 0.004700660705566406 + "x" : -0.01561669446527958, + "y" : 0.004700659774243832 }, "massData-mass" : 0.03564291819930077, "name" : "head", @@ -516,8 +516,8 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 13, - "name" : "fixture0", + "id" : 11, + "name" : "fixture2", "shapes" : [ @@ -529,34 +529,30 @@ { "x" : [ - 0.1402979493141174, - 0.1375417709350586, - 0.001378186047077179, - -0.1402979493141174, - -0.1402979493141174, - 0.001192390918731689 + -0.1156365871429443, + 0.1570904254913330, + 0.1570904254913330, + -0.1156365871429443 ], "y" : [ - -0.3207050263881683, - 0.4018019437789917, - 0.4018019437789917, - 0.3136067390441895, - -0.3432337343692780, - -0.3689299821853638 + -0.3584164977073669, + -0.3584164977073669, + 0.4034895300865173, + 0.4034895300865173 ] } } ], "id" : 9, "linearVelocity" : 0, - "massData-I" : 0.01047351956367493, + "massData-I" : 0.01153474207967520, "massData-center" : { - "x" : 0.001456731930375099, - "y" : 0.01425695233047009 + "x" : 0.02072691917419434, + "y" : 0.02253651618957520 }, - "massData-mass" : 0.2038488984107971, + "massData-mass" : 0.2077923566102982, "name" : "chest", "position" : { @@ -701,7 +697,7 @@ "name" : "joint1", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 0.01745329238474369 + "upperLimit" : 0 }, { @@ -747,13 +743,13 @@ "enableLimit" : true, "enableMotor" : false, "id" : 5, - "lowerLimit" : -0.6981316804885864, + "lowerLimit" : -0.7853981852531433, "maxMotorTorque" : 1, "motorSpeed" : 0, "name" : "joint6", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 1.919862151145935 + "upperLimit" : 1.570796370506287 }, { @@ -773,13 +769,13 @@ "enableLimit" : true, "enableMotor" : false, "id" : 6, - "lowerLimit" : -0.6981316804885864, + "lowerLimit" : -0.7853981852531433, "maxMotorTorque" : 1, "motorSpeed" : 0, "name" : "joint5", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 1.919862151145935 + "upperLimit" : 1.570796370506287 }, { From 6233588e63f64a709472e523c4b8d08d15892e64 Mon Sep 17 00:00:00 2001 From: Logsol Date: Sun, 3 May 2015 12:45:35 +0200 Subject: [PATCH 11/68] cleared items of player fingerprints (lastMovedBy). fixes #92 --- app/Game/Channel/GameObjects/Item.js | 3 + app/Game/Config/Settings.js | 2 +- app/Game/Core/GameController.js | 22 ++++- ...5T19:00:28.545Z-debug_residence_stones.rec | 98 ------------------- 4 files changed, 23 insertions(+), 102 deletions(-) delete mode 100644 recordings/Quickstart-2015-03-15T19:00:28.545Z-debug_residence_stones.rec diff --git a/app/Game/Channel/GameObjects/Item.js b/app/Game/Channel/GameObjects/Item.js index ce30779..b28a0b5 100755 --- a/app/Game/Channel/GameObjects/Item.js +++ b/app/Game/Channel/GameObjects/Item.js @@ -14,6 +14,9 @@ function (Parent) { Item.prototype = Object.create(Parent.prototype); + Item.prototype.getLastMovedBy = function() { + return this.lastMoved; + } Item.prototype.setLastMovedBy = function(player) { diff --git a/app/Game/Config/Settings.js b/app/Game/Config/Settings.js index 993e3e4..5a8d965 100755 --- a/app/Game/Config/Settings.js +++ b/app/Game/Config/Settings.js @@ -90,7 +90,7 @@ function () { CHANNEL_DEFAULT_MAX_USERS: 40, CHANNEL_DEFAULT_SCORE_LIMIT: 10, CHANNEL_DEFAULT_LEVELS: ["debug"], - CHANNEL_RECORD_SESSION: true, + CHANNEL_RECORD_SESSION: false, // ME STATE ME_STATE_MAX_DIFFERENCE_METERS: 1, diff --git a/app/Game/Core/GameController.js b/app/Game/Core/GameController.js index 4c4bf71..4f6679c 100755 --- a/app/Game/Core/GameController.js +++ b/app/Game/Core/GameController.js @@ -5,10 +5,11 @@ define([ "Lib/Utilities/NotificationCenter", "Game/" + GLOBALS.context + "/GameObjects/Doll", "Game/" + GLOBALS.context + "/GameObjects/GameObject", - "Lib/Utilities/Assert" + "Game/" + GLOBALS.context + "/GameObjects/Item", + "Lib/Utilities/Assert", ], -function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Assert) { +function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert) { "use strict"; @@ -126,6 +127,8 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Assert) { console.warn("User (", userId ,") left who has not joined"); return; } + + this.clearItemsOfPlayerFingerPrints(player); player.destroy(); delete this.players[userId]; @@ -137,6 +140,20 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Assert) { return player; }; + GameController.prototype.clearItemsOfPlayerFingerPrints = function(player) { + for (var key in this.gameObjects) { + for (var i = 0; i < this.gameObjects[key].length; i++) { // to go through animated and fixed. + var gameObject = this.gameObjects[key][i]; + if (gameObject instanceof Item) { + + if (gameObject.getLastMovedBy() && gameObject.getLastMovedBy().player === player) { + gameObject.setLastMovedBy(null); + } + } + } + } + }; + GameController.prototype.destroy = function () { var i = 0; @@ -149,7 +166,6 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Assert) { // try using a real gameobject for the health bar }*/ - for (i = 0; i < this.ncTokens.length; i++) { Nc.off(this.ncTokens[i]); } diff --git a/recordings/Quickstart-2015-03-15T19:00:28.545Z-debug_residence_stones.rec b/recordings/Quickstart-2015-03-15T19:00:28.545Z-debug_residence_stones.rec deleted file mode 100644 index be27a2c..0000000 --- a/recordings/Quickstart-2015-03-15T19:00:28.545Z-debug_residence_stones.rec +++ /dev/null @@ -1,98 +0,0 @@ -m1426446028547{"recipient":"channel","data":{"addUser":{"id":"7389285181034131943","nickname":"Bot1"}}} -m1426446029119{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"clientReady\\\":null}\"}"} -w1426446029547{"doll-7389285181034131943":{"p":{"x":26.757009396292265,"y":2.8537988666369247},"a":0,"lv":{"x":0,"y":3.686287386450715e-18},"av":0,"as":"stand","laxy":{"x":0,"y":0}},"item-6":{"p":{"x":17.676190476190477,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":20.68034223796989,"y":14.27172409912905},"a":0.05645956288623199,"lv":{"x":-0.3822032971313994,"y":0.10581586623357915},"av":-0.9131901027366345},"item-4":{"p":{"x":20.210667860242594,"y":14.23713937029844},"a":0.2172662762511257,"lv":{"x":-0.4539838684349691,"y":0.056447865910879066},"av":-0.8171646189887583},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":9.013612698412686,"y":18.087738095238098},"a":0,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.14632479802086,"y":14.27055244283271},"a":-0.030402669209750526,"lv":{"x":0.36764627338079947,"y":0.11541986576858798},"av":0.6858739292935763}} -w1426446030548{"doll-7389285181034131943":{"p":{"x":26.757009396292265,"y":2.8537988666369247},"a":0,"lv":{"x":0,"y":0},"av":0,"as":"stand","laxy":{"x":0,"y":0}},"item-6":{"p":{"x":17.676190476190477,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":20.676956793943322,"y":14.27693273489722},"a":-0.006893630787064592,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200040618322713,"y":14.276203443653712},"a":-0.0004911852214511643,"lv":{"x":-0.0017410956075321858,"y":8.552005003579723e-7},"av":3.946495907847236e-17},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":9.013612698412686,"y":18.087738095238098},"a":0,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -m1426446031024{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"lookAt\\\":{\\\"x\\\":-0.1,\\\"y\\\":0}}\"}"} -m1426446031024{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"moveLeft\\\":null}\"}"} -w1426446031550{"doll-7389285181034131943":{"p":{"x":23.369073130763105,"y":5.155903892632974},"a":0,"lv":{"x":-6.2,"y":10.122520758193609},"av":0,"as":"run","laxy":{"x":-0.1,"y":0}},"item-6":{"p":{"x":17.676190476190477,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":20.676956793943322,"y":14.27693273489722},"a":-0.006893630787064592,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":9.013612698412686,"y":18.087738095238098},"a":0,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -m1426446031695{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"mePositionStateUpdate\\\":{\\\"p\\\":{\\\"x\\\":22.546741092148903,\\\"y\\\":6.945440200409302},\\\"lv\\\":{\\\"x\\\":-6.2,\\\"y\\\":13.302715397413536}}}\"}"} -m1426446031704{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"mePositionStateUpdate\\\":{\\\"p\\\":{\\\"x\\\":22.484989092148904,\\\"y\\\":7.080524845767541},\\\"lv\\\":{\\\"x\\\":-6.2,\\\"y\\\":13.508464535823881}}}\"}"} -m1426446031782{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"stop\\\":null}\"}"} -m1426446031912{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"mePositionStateUpdate\\\":{\\\"p\\\":{\\\"x\\\":21.73476374575245,\\\"y\\\":10.32390717922336},\\\"lv\\\":{\\\"x\\\":-2.3463161980324543,\\\"y\\\":17.55729589350694}}}\"}"} -m1426446032042{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"mePositionStateUpdate\\\":{\\\"p\\\":{\\\"x\\\":21.44100843193758,\\\"y\\\":12.7671303982799},\\\"lv\\\":{\\\"x\\\":-2.227842551800874,\\\"y\\\":19.92590130886559}}}\"}"} -m1426446032126{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"mePositionStateUpdate\\\":{\\\"p\\\":{\\\"x\\\":21.2807959597357,\\\"y\\\":14.271291852124465},\\\"lv\\\":{\\\"x\\\":0,\\\"y\\\":-2.133620078919897}}}\"}"} -m1426446032164{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"handActionRequest\\\":{\\\"x\\\":-0.1,\\\"y\\\":0,\\\"av\\\":0}}\"}"} -w1426446032551{"doll-7389285181034131943":{"p":{"x":21.2807959597357,"y":14.2827540733478},"a":0,"lv":{"x":0,"y":2.0808241610672144e-17},"av":0,"as":"stand","laxy":{"x":-0.1,"y":0}},"item-6":{"p":{"x":17.676190476190477,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":20.92365310259284,"y":13.401801692395418},"a":-0.3,"lv":{"x":1.1578834351175484e-60,"y":1.9012546152460842e-16},"av":6.564623608182231e-48},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":9.013612698412686,"y":18.087738095238098},"a":0,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -m1426446032607{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"jump\\\":null}\"}"} -m1426446032783{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"lookAt\\\":{\\\"x\\\":-0.1,\\\"y\\\":0}}\"}"} -m1426446032783{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"moveLeft\\\":null}\"}"} -m1426446033408{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"handActionRequest\\\":{\\\"x\\\":-2,\\\"y\\\":1.1616379503624417,\\\"av\\\":-0.33531939942689776}}\"}"} -w1426446033552{"doll-7389285181034131943":{"p":{"x":16.557991085576948,"y":12.476641521631196},"a":0,"lv":{"x":-6.2,"y":9.458269369609303},"av":0,"as":"jump","laxy":{"x":-0.1,"y":0}},"item-6":{"p":{"x":17.676190476190477,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":12.048335711507379,"y":9.27107894546859},"a":-0.15313010305101882,"lv":{"x":-34.2,"y":-6.332771923395663},"av":1.0059581982806933},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":9.013612698412686,"y":18.087738095238098},"a":0,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -m1426446033620{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"jumpStop\\\":null}\"}"} -m1426446033708{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"stop\\\":null}\"}"} -m1426446033764{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"mePositionStateUpdate\\\":{\\\"p\\\":{\\\"x\\\":15.545509158762231,\\\"y\\\":14.939529946319917},\\\"lv\\\":{\\\"x\\\":-2.411280442117325,\\\"y\\\":13.851923076171733}}}\"}"} -m1426446033823{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"mePositionStateUpdate\\\":{\\\"p\\\":{\\\"x\\\":15.407720608611541,\\\"y\\\":15.786375605059586},\\\"lv\\\":{\\\"x\\\":-2.355804291795286,\\\"y\\\":15.018971297630832}}}\"}"} -m1426446033890{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"mePositionStateUpdate\\\":{\\\"p\\\":{\\\"x\\\":15.252508070805703,\\\"y\\\":16.84788590944936},\\\"lv\\\":{\\\"x\\\":-2.2933002802534532,\\\"y\\\":16.333499883787308}}}\"}"} -m1426446033906{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"mePositionStateUpdate\\\":{\\\"p\\\":{\\\"x\\\":15.216050100270346,\\\"y\\\":17.114162758801857},\\\"lv\\\":{\\\"x\\\":-2.278623158459831,\\\"y\\\":16.642303084531072}}}\"}"} -m1426446034032{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"lookAt\\\":{\\\"x\\\":-0.1,\\\"y\\\":0}}\"}"} -m1426446034032{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"moveLeft\\\":null}\"}"} -w1426446034554{"doll-7389285181034131943":{"p":{"x":11.194618169931237,"y":18.075345972889064},"a":0,"lv":{"x":-8,"y":-0.3919449863882458},"av":0,"as":"run","laxy":{"x":-0.1,"y":0}},"item-6":{"p":{"x":17.676190476190477,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":3.5543134118221587,"y":18.08462667589248},"a":25.09946829820324,"lv":{"x":-0.19007540236753293,"y":-0.061006264861284215},"av":-0.46231125937975326},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":9.013612698412686,"y":18.087738095238098},"a":0,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -m1426446034796{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"handActionRequest\\\":{\\\"x\\\":-0.1,\\\"y\\\":0,\\\"av\\\":0}}\"}"} -m1426446034797{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"stop\\\":null}\"}"} -m1426446035284{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"lookAt\\\":{\\\"x\\\":0.1,\\\"y\\\":0}}\"}"} -m1426446035284{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"moveRight\\\":null}\"}"} -m1426446035395{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"jump\\\":null}\"}"} -w1426446035556{"doll-7389285181034131943":{"p":{"x":10.491286858763196,"y":16.009696234603773},"a":0,"lv":{"x":6.2,"y":-10.887028542012015},"av":0,"as":"jump","laxy":{"x":0.1,"y":0}},"item-6":{"p":{"x":17.676190476190477,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":10.824620192096528,"y":15.128743853651395},"a":0.5,"lv":{"x":6.1577922291668665,"y":-10.887028542012015},"av":-1.4981364335015035e-95},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -m1426446035619{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"jumpStop\\\":null}\"}"} -m1426446035622{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"handActionRequest\\\":{\\\"x\\\":2,\\\"y\\\":1.0402407501042503,\\\"av\\\":0.4762204811665006}}\"}"} -m1426446035669{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"stop\\\":null}\"}"} -m1426446036222{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"lookAt\\\":{\\\"x\\\":0.1,\\\"y\\\":0}}\"}"} -m1426446036222{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"moveRight\\\":null}\"}"} -w1426446036557{"doll-7389285181034131943":{"p":{"x":14.892865112434567,"y":18.093198012571065},"a":0,"lv":{"x":8,"y":1.1357017756785659e-17},"av":0,"as":"run","laxy":{"x":0.1,"y":0}},"item-6":{"p":{"x":17.676190476190477,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.67263575288429,"y":9.396029900844805},"a":1.5453100773100037,"lv":{"x":1.2141986028185257,"y":1.5118096406061725},"av":7.842891058848907},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -m1426446036597{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"jump\\\":null}\"}"} -m1426446037146{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"jumpStop\\\":null}\"}"} -m1426446037146{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"stop\\\":null}\"}"} -m1426446037233{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"lookAt\\\":{\\\"x\\\":-0.1,\\\"y\\\":0}}\"}"} -m1426446037233{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"moveLeft\\\":null}\"}"} -w1426446037559{"doll-7389285181034131943":{"p":{"x":16.315888057006195,"y":18.09351694650934},"a":0,"lv":{"x":-8,"y":0},"av":0,"as":"run","laxy":{"x":-0.1,"y":0}},"item-6":{"p":{"x":17.676190476190477,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -m1426446037870{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"jump\\\":null}\"}"} -m1426446037907{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"stop\\\":null}\"}"} -m1426446037932{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"lookAt\\\":{\\\"x\\\":0.1,\\\"y\\\":0}}\"}"} -m1426446037933{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"moveRight\\\":null}\"}"} -m1426446038419{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"jumpStop\\\":null}\"}"} -m1426446038432{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"stop\\\":null}\"}"} -m1426446038538{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"handActionRequest\\\":{\\\"x\\\":0.1,\\\"y\\\":0,\\\"av\\\":0}}\"}"} -w1426446038561{"doll-7389285181034131943":{"p":{"x":17.1826631025223,"y":14.213702272433377},"a":0,"lv":{"x":2.316415665762817,"y":3.1852767893487735},"av":0,"as":"stand","laxy":{"x":0.1,"y":0}},"item-6":{"p":{"x":17.49218691204611,"y":13.332749891480995},"a":0.3,"lv":{"x":2.316415665762817,"y":3.1852767893487735},"av":0},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -m1426446038958{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"lookAt\\\":{\\\"x\\\":-0.1,\\\"y\\\":0}}\"}"} -m1426446038958{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"moveLeft\\\":null}\"}"} -m1426446038996{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"jump\\\":null}\"}"} -m1426446039345{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"stop\\\":null}\"}"} -m1426446039357{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"jumpStop\\\":null}\"}"} -w1426446039562{"doll-7389285181034131943":{"p":{"x":14.373155722224688,"y":10.923172851093172},"a":0,"lv":{"x":-2.3491405651705346,"y":3.215539708036451},"av":0,"as":"jump","laxy":{"x":-0.1,"y":0}},"item-6":{"p":{"x":14.063631912700878,"y":10.04222047014079},"a":-0.3,"lv":{"x":-2.3491405651705346,"y":3.215539708036451},"av":1.4981364335015035e-95},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -m1426446039848{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"jump\\\":null}\"}"} -m1426446039870{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"lookAt\\\":{\\\"x\\\":-0.1,\\\"y\\\":0}}\"}"} -m1426446039870{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"moveLeft\\\":null}\"}"} -m1426446039961{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"mePositionStateUpdate\\\":{\\\"p\\\":{\\\"x\\\":13.763554582654288,\\\"y\\\":9.91021111614182},\\\"lv\\\":{\\\"x\\\":-6.2,\\\"y\\\":-12.214568104301154}}}\"}"} -m1426446040457{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"jumpStop\\\":null}\"}"} -m1426446040491{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"stop\\\":null}\"}"} -w1426446040564{"doll-7389285181034131943":{"p":{"x":9.827992197957391,"y":7.616287969672424},"a":0,"lv":{"x":-0.0000010315612595218654,"y":-0.3467108761433166},"av":0,"as":"stand","laxy":{"x":-0.1,"y":0}},"item-6":{"p":{"x":9.51846838843358,"y":6.735335588720043},"a":-0.3,"lv":{"x":-0.0000010315612595218745,"y":-0.3467108761433166},"av":-3.237869826367756e-34},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -m1426446040814{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"handActionRequest\\\":{\\\"x\\\":null,\\\"y\\\":null,\\\"av\\\":0}}\"}"} -m1426446041546{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"lookAt\\\":{\\\"x\\\":-0.1,\\\"y\\\":0}}\"}"} -m1426446041546{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"moveLeft\\\":null}\"}"} -w1426446041565{"doll-7389285181034131943":{"p":{"x":9.695420727381228,"y":7.6162879696953505},"a":0,"lv":{"x":-8,"y":0},"av":0,"as":"run","laxy":{"x":-0.1,"y":0}},"item-6":{"p":{"x":9.401617976491387,"y":7.516140983169705},"a":-1.564982640581702,"lv":{"x":0.0015602824631008733,"y":-0.0055646575139384315},"av":0.0151800309605853},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -m1426446041708{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"stop\\\":null}\"}"} -m1426446042118{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"handActionRequest\\\":{\\\"x\\\":-0.1,\\\"y\\\":0,\\\"av\\\":0}}\"}"} -m1426446042420{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"lookAt\\\":{\\\"x\\\":-0.1,\\\"y\\\":0}}\"}"} -m1426446042420{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"moveLeft\\\":null}\"}"} -w1426446042568{"doll-7389285181034131943":{"p":{"x":7.146502745202811,"y":7.6190476190527345},"a":0,"lv":{"x":-8,"y":1.8167431059639174e-9},"av":0,"as":"run","laxy":{"x":-0.1,"y":0}},"item-6":{"p":{"x":6.836978935679003,"y":6.738095238100354},"a":-0.3,"lv":{"x":-7.710315253398224,"y":1.816743105963944e-9},"av":-1.2647929009154966e-36},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -m1426446042873{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"stop\\\":null}\"}"} -m1426446042996{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"lookAt\\\":{\\\"x\\\":0.1,\\\"y\\\":0}}\"}"} -m1426446042996{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"moveRight\\\":null}\"}"} -m1426446043102{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"handActionRequest\\\":{\\\"x\\\":2,\\\"y\\\":0.24735158698021256,\\\"av\\\":-0.506800103937166}}\"}"} -m1426446043149{"recipient":"7389285181034131943","data":"{\"gameCommand\":\"{\\\"stop\\\":null}\"}"} -w1426446043570{"doll-7389285181034131943":{"p":{"x":6.717469927715379,"y":18.026718836374023},"a":0,"lv":{"x":0,"y":-1.5933058441069676},"av":0,"as":"stand","laxy":{"x":0.1,"y":0}},"item-6":{"p":{"x":15.346920374111809,"y":8.242346533188677},"a":13.745544723304238,"lv":{"x":8.865053038008881,"y":-6.948476024418163},"av":40.16880149763361},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -w1426446044571{"doll-7389285181034131943":{"p":{"x":6.717469927715379,"y":18.094932218730197},"a":0,"lv":{"x":0,"y":0},"av":0,"as":"stand","laxy":{"x":0.1,"y":0}},"item-6":{"p":{"x":24.736836349036146,"y":14.105602828936636},"a":53.954515022435494,"lv":{"x":8.865053038008881,"y":19.077523975581837},"av":40.16880149763361},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -w1426446045571{"doll-7389285181034131943":{"p":{"x":6.717469927715379,"y":18.094932218730197},"a":0,"lv":{"x":0,"y":0},"av":0,"as":"stand","laxy":{"x":0.1,"y":0}},"item-6":{"p":{"x":25.484252760088392,"y":17.1308518892069},"a":56.5833675581005,"lv":{"x":0.04489757650580847,"y":-0.010299028060006578},"av":0.12321006381376746},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -w1426446046572{"doll-7389285181034131943":{"p":{"x":6.717469927715379,"y":18.094932218730197},"a":0,"lv":{"x":0,"y":0},"av":0,"as":"stand","laxy":{"x":0.1,"y":0}},"item-6":{"p":{"x":25.484809555865787,"y":17.13345683956885},"a":56.55108306250028,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -w1426446047573{"doll-7389285181034131943":{"p":{"x":6.717469927715379,"y":18.094932218730197},"a":0,"lv":{"x":0,"y":0},"av":0,"as":"stand","laxy":{"x":0.1,"y":0}},"item-6":{"p":{"x":25.484809555865787,"y":17.13345683956885},"a":56.55108306250028,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -w1426446048574{"doll-7389285181034131943":{"p":{"x":6.717469927715379,"y":18.094932218730197},"a":0,"lv":{"x":0,"y":0},"av":0,"as":"stand","laxy":{"x":0.1,"y":0}},"item-6":{"p":{"x":25.484809555865787,"y":17.13345683956885},"a":56.55108306250028,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -w1426446049575{"doll-7389285181034131943":{"p":{"x":6.717469927715379,"y":18.094932218730197},"a":0,"lv":{"x":0,"y":0},"av":0,"as":"stand","laxy":{"x":0.1,"y":0}},"item-6":{"p":{"x":25.484809555865787,"y":17.13345683956885},"a":56.55108306250028,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -w1426446050576{"doll-7389285181034131943":{"p":{"x":6.717469927715379,"y":18.094932218730197},"a":0,"lv":{"x":0,"y":0},"av":0,"as":"stand","laxy":{"x":0.1,"y":0}},"item-6":{"p":{"x":25.484809555865787,"y":17.13345683956885},"a":56.55108306250028,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -m1426446051478{"recipient":"channel","data":{"releaseUser":"7389285181034131943"}} -w1426446051575{"item-6":{"p":{"x":25.484809555865787,"y":17.13345683956885},"a":56.55108306250028,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -w1426446052576{"item-6":{"p":{"x":25.484809555865787,"y":17.13345683956885},"a":56.55108306250028,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -w1426446053576{"item-6":{"p":{"x":25.484809555865787,"y":17.13345683956885},"a":56.55108306250028,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -w1426446054579{"item-6":{"p":{"x":25.484809555865787,"y":17.13345683956885},"a":56.55108306250028,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -w1426446055579{"item-6":{"p":{"x":25.484809555865787,"y":17.13345683956885},"a":56.55108306250028,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -w1426446056580{"item-6":{"p":{"x":25.484809555865787,"y":17.13345683956885},"a":56.55108306250028,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} -w1426446057580{"item-6":{"p":{"x":25.484809555865787,"y":17.13345683956885},"a":56.55108306250028,"lv":{"x":0,"y":0},"av":0},"item-5":{"p":{"x":3.551564486509986,"y":18.086205519078288},"a":25.13402937147234,"lv":{"x":0,"y":0},"av":0},"item-4":{"p":{"x":20.200046042197616,"y":14.276203440989589},"a":-0.0004911852214511747,"lv":{"x":0,"y":0},"av":0},"item-3":{"p":{"x":22.4,"y":14.277445638095237},"a":0,"lv":{"x":0,"y":0},"av":0},"item-2":{"p":{"x":25.676240547787568,"y":9.396188210902643},"a":1.5696221500784544,"lv":{"x":0,"y":0},"av":0},"item-1":{"p":{"x":19.642184126984116,"y":14.278214285714286},"a":0,"lv":{"x":0,"y":0},"av":0},"item-0":{"p":{"x":19.147450032657666,"y":14.276009262801196},"a":0.0025201794161469693,"lv":{"x":0,"y":0},"av":0}} From 413f5424c23310946edf722b9ba9a659870c7857 Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 4 May 2015 14:01:23 +0200 Subject: [PATCH 12/68] added setting to switch off pointer lock filter --- app/Game/Client/View/Pixi/View.js | 5 ++++- app/Game/Config/Settings.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Game/Client/View/Pixi/View.js b/app/Game/Client/View/Pixi/View.js index d191bae..62c2fc5 100755 --- a/app/Game/Client/View/Pixi/View.js +++ b/app/Game/Client/View/Pixi/View.js @@ -121,7 +121,8 @@ function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, Layer } PixiView.prototype.initPointerLockView = function() { - + if (!Settings.ENABLE_POINTER_LOCK_FILTER) return; + var blurFilter = new PIXI.BlurFilter(); blurFilter.blurX = 42 * this.currentZoom; blurFilter.blurY = 42 * this.currentZoom; @@ -139,6 +140,8 @@ function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, Layer }; PixiView.prototype.onPointerLockChange = function(isLocked, options) { + if (!Settings.ENABLE_POINTER_LOCK_FILTER) return; + if(isLocked) { this.container.filters = null; this.clickToEnable.visible = false; diff --git a/app/Game/Config/Settings.js b/app/Game/Config/Settings.js index 4e93113..0771d84 100755 --- a/app/Game/Config/Settings.js +++ b/app/Game/Config/Settings.js @@ -39,6 +39,7 @@ function () { VIEW_CONTROLLER: 0 ? "Three" : "Pixi", ARROW_GLIDE: 30, // % of the way per frame SHOW_LAYER_INFO: false, + ENABLE_POINTER_LOCK_FILTER: false, // GAME PLAY WALK_SPEED: 4, From 8da2d48643d18250e6d96573d3d6d486ed0e8659 Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 4 May 2015 14:02:53 +0200 Subject: [PATCH 13/68] centered rubedoll head --- app/Game/Asset/RubeDoll.json | 942 ++++++++++++++++----------------- static/items/rube/ragdoll.rube | 72 +-- 2 files changed, 507 insertions(+), 507 deletions(-) diff --git a/app/Game/Asset/RubeDoll.json b/app/Game/Asset/RubeDoll.json index 37e4c0e..6f526a2 100644 --- a/app/Game/Asset/RubeDoll.json +++ b/app/Game/Asset/RubeDoll.json @@ -5,57 +5,6 @@ "body" : [ - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture2", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.1570904254913330, - 0.1570904254913330, - -0.1156365871429443, - -0.1156365871429443 - ], - "y" : - [ - -0.3584164977073669, - 0.4034895300865173, - 0.4034895300865173, - -0.3584164977073669 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.01153474207967520, - "massData-center" : - { - "x" : 0.02072691917419434, - "y" : 0.02253651618957520 - }, - "massData-mass" : 0.2077923566102982, - "name" : "chest", - "position" : - { - "x" : -0.04104747623205185, - "y" : 0.7829875946044922 - }, - "type" : 2 - }, - { "angle" : 0, "angularVelocity" : 0, @@ -101,8 +50,8 @@ "name" : "upperLeftArm", "position" : { - "x" : -0.1362041532993317, - "y" : 0.9068759679794312 + "x" : -0.1165364086627960, + "y" : 0.9012566804885864 }, "type" : 2 }, @@ -118,42 +67,42 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "name" : "fixture3", + "name" : "fixture2", "polygon" : { "vertices" : { "x" : [ - 0.07039496302604675, - 0.07039496302604675, - -0.07039486616849899, - -0.07039486616849899 + 0.1570899933576584, + 0.1570899933576584, + -0.1156369969248772, + -0.1156369969248772 ], "y" : [ - -0.09294389933347702, - 0.1276105940341949, - 0.1276105940341949, - -0.09294389933347702 + -0.3584159910678864, + 0.4034900069236755, + 0.4034900069236755, + -0.3584159910678864 ] } } } ], "linearVelocity" : 0, - "massData-I" : 0.0001864957448560745, + "massData-I" : 0.01153474114835262, "massData-center" : { - "x" : 4.842877032729120e-08, - "y" : 0.01733334921300411 + "x" : 0.02072649449110031, + "y" : 0.02253700792789459 }, - "massData-mass" : 0.03105182945728302, - "name" : "lowerRightLeg", + "massData-mass" : 0.2077923268079758, + "name" : "chest", "position" : { - "x" : 0.02818956598639488, - "y" : 0.1036150008440018 + "x" : -0.02137973159551620, + "y" : 0.7773683071136475 }, "type" : 2 }, @@ -166,249 +115,34 @@ [ { - "density" : 1, + "circle" : + { + "center" : + { + "x" : -0.01561669446527958, + "y" : 0.004700659774243832 + }, + "radius" : 0.2268356680870056 + }, + "density" : 0.2204959988594055, "filter-groupIndex" : -55, "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.07039505988359451, - 0.07039505988359451, - -0.07039495557546616, - -0.07039495557546616 - ], - "y" : - [ - -0.1890522241592407, - 0.1890524625778198, - 0.1890524625778198, - -0.1890522241592407 - ] - } - } + "name" : "fixture1" } ], "linearVelocity" : 0, - "massData-I" : 0.000722132739610970, + "massData-I" : 0.0009264730615541339, "massData-center" : { - "x" : 5.215406417846680e-08, - "y" : 1.192092824453539e-07 + "x" : -0.01561669446527958, + "y" : 0.004700659774243832 }, - "massData-mass" : 0.05323336645960808, - "name" : "upperLeftLeg", + "massData-mass" : 0.03564291819930077, + "name" : "head", "position" : { - "x" : -0.06537666171789169, - "y" : 0.3381301760673523 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.07039503753185272, - 0.07039503753185272, - -0.07039495557546616, - -0.07039495557546616 - ], - "y" : - [ - -0.09294363856315613, - 0.1277718394994736, - 0.1277718394994736, - -0.09294363856315613 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0001869033440016210, - "massData-center" : - { - "x" : 4.097818973036738e-08, - "y" : 0.01741409860551357 - }, - "massData-mass" : 0.03107452951371670, - "name" : "lowerLeftLeg", - "position" : - { - "x" : -0.06537666171789169, - "y" : 0.1036150008440018 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.04693000763654709, - 0.04693000763654709, - -0.04692991077899933, - -0.04692991077899933 - ], - "y" : - [ - -0.1159216761589050, - 0.1159217953681946, - 0.1159217953681946, - -0.1159216761589050 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0001134483172791079, - "massData-center" : - { - "x" : 4.842877032729120e-08, - "y" : 5.960464477539062e-08 - }, - "massData-mass" : 0.02176081016659737, - "name" : "lowerLeftArm", - "position" : - { - "x" : -0.1362059414386749, - "y" : 0.6898344159126282 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.07039496302604675, - 0.07039496302604675, - -0.07039486616849899, - -0.07039486616849899 - ], - "y" : - [ - -0.1890522241592407, - 0.1890524625778198, - 0.1890524625778198, - -0.1890522241592407 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0007221315754577518, - "massData-center" : - { - "x" : 4.842877388000488e-08, - "y" : 1.192092895507812e-07 - }, - "massData-mass" : 0.05323329567909241, - "name" : "upperRightLeg", - "position" : - { - "x" : 0.02818956598639488, - "y" : 0.3381301760673523 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.04693000018596649, - 0.04693000018596649, - -0.04693005979061127, - -0.04693005979061127 - ], - "y" : - [ - -0.1895973682403564, - 0.1895966529846191, - 0.1895966529846191, - -0.1895973682403564 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0004525946278590709, - "massData-center" : - { - "x" : -2.980232238769531e-08, - "y" : -3.576278686523438e-07 - }, - "massData-mass" : 0.03559117391705513, - "name" : "upperRightArm", - "position" : - { - "x" : 0.09864036738872528, - "y" : 0.9068759679794312 + "x" : 0.02309736609458923, + "y" : 1.497289657592773 }, "type" : 2 }, @@ -458,8 +192,8 @@ "name" : "lowerRightArm", "position" : { - "x" : 0.09864036738872528, - "y" : 0.6898344159126282 + "x" : 0.1183081120252609, + "y" : 0.6842151284217834 }, "type" : 2 }, @@ -472,34 +206,300 @@ [ { - "circle" : - { - "center" : - { - "x" : -0.01561669446527958, - "y" : 0.004700659774243832 - }, - "radius" : 0.2268356680870056 - }, - "density" : 0.2204959988594055, + "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "name" : "fixture1" + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.07039503753185272, + 0.07039503753185272, + -0.07039495557546616, + -0.07039495557546616 + ], + "y" : + [ + -0.09294363856315613, + 0.1277718394994736, + 0.1277718394994736, + -0.09294363856315613 + ] + } + } } ], "linearVelocity" : 0, - "massData-I" : 0.0009264730615541339, + "massData-I" : 0.0001869033440016210, "massData-center" : { - "x" : -0.01561669446527958, - "y" : 0.004700659774243832 + "x" : 4.097818973036738e-08, + "y" : 0.01741409860551357 }, - "massData-mass" : 0.03564291819930077, - "name" : "head", + "massData-mass" : 0.03107452951371670, + "name" : "lowerLeftLeg", "position" : { - "x" : 0.009572610259056091, - "y" : 1.462979435920715 + "x" : -0.04570891708135605, + "y" : 0.09799571335315704 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.04693000763654709, + 0.04693000763654709, + -0.04692991077899933, + -0.04692991077899933 + ], + "y" : + [ + -0.1159216761589050, + 0.1159217953681946, + 0.1159217953681946, + -0.1159216761589050 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0001134483172791079, + "massData-center" : + { + "x" : 4.842877032729120e-08, + "y" : 5.960464477539062e-08 + }, + "massData-mass" : 0.02176081016659737, + "name" : "lowerLeftArm", + "position" : + { + "x" : -0.1165381968021393, + "y" : 0.6842151284217834 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.04693000018596649, + 0.04693000018596649, + -0.04693005979061127, + -0.04693005979061127 + ], + "y" : + [ + -0.1895973682403564, + 0.1895966529846191, + 0.1895966529846191, + -0.1895973682403564 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0004525946278590709, + "massData-center" : + { + "x" : -2.980232238769531e-08, + "y" : -3.576278686523438e-07 + }, + "massData-mass" : 0.03559117391705513, + "name" : "upperRightArm", + "position" : + { + "x" : 0.1183081120252609, + "y" : 0.9012566804885864 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.07039496302604675, + 0.07039496302604675, + -0.07039486616849899, + -0.07039486616849899 + ], + "y" : + [ + -0.1890522241592407, + 0.1890524625778198, + 0.1890524625778198, + -0.1890522241592407 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0007221315754577518, + "massData-center" : + { + "x" : 4.842877388000488e-08, + "y" : 1.192092895507812e-07 + }, + "massData-mass" : 0.05323329567909241, + "name" : "upperRightLeg", + "position" : + { + "x" : 0.04785731062293053, + "y" : 0.3325108885765076 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.07039505988359451, + 0.07039505988359451, + -0.07039495557546616, + -0.07039495557546616 + ], + "y" : + [ + -0.1890522241592407, + 0.1890524625778198, + 0.1890524625778198, + -0.1890522241592407 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.000722132739610970, + "massData-center" : + { + "x" : 5.215406417846680e-08, + "y" : 1.192092824453539e-07 + }, + "massData-mass" : 0.05323336645960808, + "name" : "upperLeftLeg", + "position" : + { + "x" : -0.04570891708135605, + "y" : 0.3325108885765076 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.07039496302604675, + 0.07039496302604675, + -0.07039486616849899, + -0.07039486616849899 + ], + "y" : + [ + -0.09294389933347702, + 0.1276105940341949, + 0.1276105940341949, + -0.09294389933347702 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0001864957448560745, + "massData-center" : + { + "x" : 4.842877032729120e-08, + "y" : 0.01733334921300411 + }, + "massData-mass" : 0.03105182945728302, + "name" : "lowerRightLeg", + "position" : + { + "x" : 0.04785731062293053, + "y" : 0.09799571335315704 }, "type" : 2 } @@ -554,144 +554,19 @@ { "anchorA" : { - "x" : -0.06799929589033127, - "y" : -0.2890855073928833 + "x" : 0.02210754156112671, + "y" : 0.4607425928115845 }, "anchorB" : { - "x" : -0.04493143409490585, - "y" : 0.1559127867221832 + "x" : -0.02544101513922215, + "y" : -0.2591779232025146 }, - "bodyA" : 0, - "bodyB" : 3, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -0.6981316804885864, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint6", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 1.919862151145935 - }, - - { - "anchorA" : - { - "x" : 0.1116365119814873, - "y" : -0.2944114208221436 - }, - "anchorB" : - { - "x" : 0.04127830639481544, - "y" : 0.1504460573196411 - }, - "bodyA" : 0, - "bodyB" : 6, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -0.6981316804885864, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint5", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 1.919862151145935 - }, - - { - "anchorA" : - { - "x" : -0.0007802918553352356, - "y" : -0.1484908312559128 - }, - "anchorB" : - { - "x" : -0.0007800981402397156, - "y" : 0.08614097535610199 - }, - "bodyA" : 3, - "bodyB" : 4, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : 0.01745329238474369, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint7", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 2.268928050994873 - }, - - { - "anchorA" : - { - "x" : 0.001979876309633255, - "y" : -0.1506856828927994 - }, - "anchorB" : - { - "x" : 0.001979988068342209, - "y" : 0.08382888138294220 - }, - "bodyA" : 6, + "bodyA" : 1, "bodyB" : 2, "enableLimit" : true, "enableMotor" : false, "jointSpeed" : 0, - "lowerLimit" : 0.01745329238474369, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint8", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 2.268928050994873 - }, - - { - "anchorA" : - { - "x" : 0.0003538504242897034, - "y" : 0.07107692956924438 - }, - "anchorB" : - { - "x" : 0.0003536641597747803, - "y" : -0.1459646224975586 - }, - "bodyA" : 8, - "bodyB" : 7, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -1.919862151145935, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint1", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 0 - }, - - { - "anchorA" : - { - "x" : 0.06392270326614380, - "y" : 0.4330990314483643 - }, - "anchorB" : - { - "x" : 0.01330260001122952, - "y" : -0.2468919754028320 - }, - "bodyA" : 0, - "bodyB" : 9, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, "lowerLimit" : -0.6981316804885864, "maxMotorTorque" : 0, "motorSpeed" : 0, @@ -704,32 +579,32 @@ { "anchorA" : { - "x" : 0.1396137326955795, - "y" : 0.2701327800750732 + "x" : 0.0008554458618164062, + "y" : -0.1461489200592041 }, "anchorB" : { - "x" : -7.455050945281982e-05, - "y" : 0.1462446451187134 + "x" : 0.0008557140827178955, + "y" : 0.07089227437973022 }, "bodyA" : 0, - "bodyB" : 7, - "enableLimit" : false, + "bodyB" : 5, + "enableLimit" : true, "enableMotor" : false, "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, + "lowerLimit" : -1.919862151145935, "maxMotorTorque" : 1, "motorSpeed" : 0, - "name" : "joint2", + "name" : "joint4", "refAngle" : 0, "type" : "revolute", - "upperLimit" : 3.141592741012573 + "upperLimit" : 0.01745329238474369 }, { "anchorA" : { - "x" : -0.09517393261194229, + "x" : -0.09517394006252289, "y" : 0.2718780040740967 }, "anchorB" : @@ -737,8 +612,8 @@ "x" : -1.741945743560791e-05, "y" : 0.1479903459548950 }, - "bodyA" : 0, - "bodyB" : 1, + "bodyA" : 1, + "bodyB" : 0, "enableLimit" : false, "enableMotor" : false, "jointSpeed" : 0, @@ -754,26 +629,151 @@ { "anchorA" : { - "x" : 0.0008554458618164062, - "y" : -0.1461489200592041 + "x" : 0.1116365119814873, + "y" : -0.2944114208221436 }, "anchorB" : { - "x" : 0.0008557140827178955, - "y" : 0.07089227437973022 + "x" : 0.04127830639481544, + "y" : 0.1504460573196411 }, "bodyA" : 1, - "bodyB" : 5, + "bodyB" : 7, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.7853981852531433, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint5", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.570796370506287 + }, + + { + "anchorA" : + { + "x" : -0.06799929589033127, + "y" : -0.2890855073928833 + }, + "anchorB" : + { + "x" : -0.04493143409490585, + "y" : 0.1559127867221832 + }, + "bodyA" : 1, + "bodyB" : 8, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.7853981852531433, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint6", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.570796370506287 + }, + + { + "anchorA" : + { + "x" : 0.1396137326955795, + "y" : 0.2701327800750732 + }, + "anchorB" : + { + "x" : -7.455050945281982e-05, + "y" : 0.1462446451187134 + }, + "bodyA" : 1, + "bodyB" : 6, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint2", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : 0.0003538504242897034, + "y" : 0.07107692956924438 + }, + "anchorB" : + { + "x" : 0.0003536641597747803, + "y" : -0.1459646224975586 + }, + "bodyA" : 3, + "bodyB" : 6, "enableLimit" : true, "enableMotor" : false, "jointSpeed" : 0, "lowerLimit" : -1.919862151145935, "maxMotorTorque" : 1, "motorSpeed" : 0, - "name" : "joint4", + "name" : "joint1", "refAngle" : 0, "type" : "revolute", - "upperLimit" : 0.01745329238474369 + "upperLimit" : 0 + }, + + { + "anchorA" : + { + "x" : 0.001979876309633255, + "y" : -0.1506856828927994 + }, + "anchorB" : + { + "x" : 0.001979988068342209, + "y" : 0.08382888138294220 + }, + "bodyA" : 7, + "bodyB" : 9, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0.01745329238474369, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint8", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 2.268928050994873 + }, + + { + "anchorA" : + { + "x" : -0.0007802955806255341, + "y" : -0.1484908312559128 + }, + "anchorB" : + { + "x" : -0.0007801018655300140, + "y" : 0.08614097535610199 + }, + "bodyA" : 8, + "bodyB" : 4, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0.01745329238474369, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint7", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 2.268928050994873 } ], "positionIterations" : 3, diff --git a/static/items/rube/ragdoll.rube b/static/items/rube/ragdoll.rube index 5a3b727..7024172 100644 --- a/static/items/rube/ragdoll.rube +++ b/static/items/rube/ragdoll.rube @@ -111,8 +111,8 @@ "name" : "lowerRightLeg", "position" : { - "x" : 0.02818956598639488, - "y" : 0.1036150008440018 + "x" : 0.04785731062293053, + "y" : 0.09799571335315704 }, "type" : "dynamic" }, @@ -168,8 +168,8 @@ "name" : "upperLeftLeg", "position" : { - "x" : -0.06537666171789169, - "y" : 0.3381301760673523 + "x" : -0.04570891708135605, + "y" : 0.3325108885765076 }, "type" : "dynamic" }, @@ -225,8 +225,8 @@ "name" : "upperRightLeg", "position" : { - "x" : 0.02818956598639488, - "y" : 0.3381301760673523 + "x" : 0.04785731062293053, + "y" : 0.3325108885765076 }, "type" : "dynamic" }, @@ -282,8 +282,8 @@ "name" : "upperRightArm", "position" : { - "x" : 0.09864036738872528, - "y" : 0.9068759679794312 + "x" : 0.1183081120252609, + "y" : 0.9012566804885864 }, "type" : "dynamic" }, @@ -339,8 +339,8 @@ "name" : "lowerLeftArm", "position" : { - "x" : -0.1362059414386749, - "y" : 0.6898344159126282 + "x" : -0.1165381968021393, + "y" : 0.6842151284217834 }, "type" : "dynamic" }, @@ -396,8 +396,8 @@ "name" : "lowerLeftLeg", "position" : { - "x" : -0.06537666171789169, - "y" : 0.1036150008440018 + "x" : -0.04570891708135605, + "y" : 0.09799571335315704 }, "type" : "dynamic" }, @@ -453,8 +453,8 @@ "name" : "lowerRightArm", "position" : { - "x" : 0.09864036738872528, - "y" : 0.6898344159126282 + "x" : 0.1183081120252609, + "y" : 0.6842151284217834 }, "type" : "dynamic" }, @@ -499,8 +499,8 @@ "name" : "head", "position" : { - "x" : 0.009572610259056091, - "y" : 1.462979435920715 + "x" : 0.02309736609458923, + "y" : 1.497289657592773 }, "type" : "dynamic" }, @@ -529,35 +529,35 @@ { "x" : [ - -0.1156365871429443, - 0.1570904254913330, - 0.1570904254913330, - -0.1156365871429443 + -0.1156369969248772, + 0.1570899933576584, + 0.1570899933576584, + -0.1156369969248772 ], "y" : [ - -0.3584164977073669, - -0.3584164977073669, - 0.4034895300865173, - 0.4034895300865173 + -0.3584159910678864, + -0.3584159910678864, + 0.4034900069236755, + 0.4034900069236755 ] } } ], "id" : 9, "linearVelocity" : 0, - "massData-I" : 0.01153474207967520, + "massData-I" : 0.01153474114835262, "massData-center" : { - "x" : 0.02072691917419434, - "y" : 0.02253651618957520 + "x" : 0.02072649449110031, + "y" : 0.02253700792789459 }, - "massData-mass" : 0.2077923566102982, + "massData-mass" : 0.2077923268079758, "name" : "chest", "position" : { - "x" : -0.04104747623205185, - "y" : 0.7829875946044922 + "x" : -0.02137973159551620, + "y" : 0.7773683071136475 }, "type" : "dynamic" }, @@ -613,8 +613,8 @@ "name" : "upperLeftArm", "position" : { - "x" : -0.1362041532993317, - "y" : 0.9068759679794312 + "x" : -0.1165364086627960, + "y" : 0.9012566804885864 }, "type" : "dynamic" } @@ -833,13 +833,13 @@ { "anchorA" : { - "x" : 0.06392270326614380, - "y" : 0.4330990016460419 + "x" : 0.02210754156112671, + "y" : 0.4607425630092621 }, "anchorB" : { - "x" : 0.01330260001122952, - "y" : -0.2468920052051544 + "x" : -0.02544101513922215, + "y" : -0.2591779530048370 }, "bodyA" : 9, "bodyB" : 8, From 1db8de34dffdb5dead9f8fd7a24c04825881f565 Mon Sep 17 00:00:00 2001 From: logsol Date: Wed, 6 May 2015 20:11:12 +0200 Subject: [PATCH 14/68] added possibility to not debug-draw sensor shapes --- app/Lib/Vendor/Box2D.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Lib/Vendor/Box2D.js b/app/Lib/Vendor/Box2D.js index 0e1e7c5..760681d 100755 --- a/app/Lib/Vendor/Box2D.js +++ b/app/Lib/Vendor/Box2D.js @@ -6006,6 +6006,10 @@ Box2D.postDefs = []; xf = b.m_xf; for (f = b.GetFixtureList(); f; f = f.m_next) { + // Disable drawing sensors by removing false || + if (false || f.IsSensor()) { + continue; + } s = f.GetShape(); if (b.IsActive() == false) { color.Set(0.5, 0.5, 0.3); From ec7ce459cb3d076ac2b67cce8eec15ad93a9b09c Mon Sep 17 00:00:00 2001 From: logsol Date: Wed, 6 May 2015 20:13:13 +0200 Subject: [PATCH 15/68] added swapMeshes method to swap textures of 2 meshes --- app/Game/Client/View/LayerManager.js | 8 +++++++- app/Game/Client/View/Pixi/Layer.js | 16 ++++++++++++++++ app/Lib/Utilities/NotificationCenter.js | 3 ++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/app/Game/Client/View/LayerManager.js b/app/Game/Client/View/LayerManager.js index 7adec2f..8245e3f 100644 --- a/app/Game/Client/View/LayerManager.js +++ b/app/Game/Client/View/LayerManager.js @@ -21,7 +21,8 @@ function (Nc, Exception, Layer) { Nc.on(Nc.ns.client.view.mesh.update, this.updateMesh, this), Nc.on(Nc.ns.client.view.mesh.addFilter, this.addFilter, this), Nc.on(Nc.ns.client.view.mesh.removeFilter, this.removeFilter, this), - Nc.on(Nc.ns.client.view.mesh.swapMeshIndexes, this.swapMeshIndexes, this) + Nc.on(Nc.ns.client.view.mesh.swapMeshIndexes, this.swapMeshIndexes, this), + Nc.on(Nc.ns.client.view.mesh.swapMeshes, this.swapMeshes, this) ]; } @@ -163,6 +164,11 @@ function (Nc, Exception, Layer) { this.delegate.apply(this, arguments); }; + LayerManager.prototype.swapMeshes = function() { + Array.prototype.splice.call(arguments, 0, 0, 'swapMeshes') + this.delegate.apply(this, arguments); + }; + LayerManager.prototype.destroy = function() { for (var i = 0; i < this.ncTokens.length; i++) { Nc.off(this.ncTokens[i]); diff --git a/app/Game/Client/View/Pixi/Layer.js b/app/Game/Client/View/Pixi/Layer.js index 58a0fd8..4d6465f 100644 --- a/app/Game/Client/View/Pixi/Layer.js +++ b/app/Game/Client/View/Pixi/Layer.js @@ -103,6 +103,22 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings, ColorConverter, Nc) { this.container.setChildIndex(meshB, indexA); }; + Layer.prototype.swapMeshes = function(meshA, meshB) { + var textureA = meshA.texture; + var textureB = meshB.texture; + + meshA.setTexture(textureB); + meshA.onTextureUpdate(); + meshA.scale.x = 1; + meshA.scale.y = 1; + + meshB.setTexture(textureA); + meshB.onTextureUpdate(); + meshB.scale.x = 1; + meshB.scale.y = 1; + + }; + Layer.prototype.createMesh = function (texturePath, callback, options) { var texture = (options && options.fromFrame) diff --git a/app/Lib/Utilities/NotificationCenter.js b/app/Lib/Utilities/NotificationCenter.js index ec4beb3..62496ba 100755 --- a/app/Lib/Utilities/NotificationCenter.js +++ b/app/Lib/Utilities/NotificationCenter.js @@ -42,7 +42,8 @@ function (Exception) { update: null, addFilter: null, removeFilter: null, - swapMeshIndexes: null + swapMeshIndexes: null, + swapMeshes: null }, animatedMesh: { create: null From 6d8609b47555916458768f261156f6aa4efeb0ec Mon Sep 17 00:00:00 2001 From: logsol Date: Wed, 6 May 2015 20:15:22 +0200 Subject: [PATCH 16/68] improving rube doll flipping behaviour and positioning --- app/Game/Asset/RubeDoll.json | 474 +++++++++--------- app/Game/Client/GameObjects/Items/RubeDoll.js | 58 ++- app/Game/Core/GameObjects/Items/RubeDoll.js | 13 +- static/img/Characters/Chuck/lowerLeftArm.png | Bin 148 -> 2776 bytes static/img/Characters/Chuck/lowerLeftLeg.png | Bin 158 -> 2785 bytes static/img/Characters/Chuck/lowerRightArm.png | Bin 148 -> 2776 bytes static/img/Characters/Chuck/lowerRightLeg.png | Bin 158 -> 2785 bytes static/img/Characters/Chuck/upperLeftArm.png | Bin 145 -> 2793 bytes static/img/Characters/Chuck/upperRightArm.png | Bin 170 -> 2793 bytes static/img/Characters/Chuck/upperRightLeg.png | Bin 2866 -> 2822 bytes static/items/rube/ragdoll.rube | 198 ++++---- 11 files changed, 383 insertions(+), 360 deletions(-) diff --git a/app/Game/Asset/RubeDoll.json b/app/Game/Asset/RubeDoll.json index 6f526a2..a7b9312 100644 --- a/app/Game/Asset/RubeDoll.json +++ b/app/Game/Asset/RubeDoll.json @@ -23,17 +23,17 @@ { "x" : [ - 0.04692991077899933, - 0.04692991077899933, - -0.04692997038364410, - -0.04692997038364410 + 0.04692989960312843, + 0.04692989960312843, + -0.04693000018596649, + -0.04693000018596649 ], "y" : [ - -0.1895973682403564, - 0.1895966529846191, - 0.1895966529846191, - -0.1895973682403564 + -0.1895969957113266, + 0.1895969957113266, + 0.1895969957113266, + -0.1895969957113266 ] } } @@ -43,15 +43,15 @@ "massData-I" : 0.0004525936674326658, "massData-center" : { - "x" : -2.980232238769531e-08, - "y" : -3.576278686523438e-07 + "x" : -5.029141902923584e-08, + "y" : 0 }, "massData-mass" : 0.03559110686182976, "name" : "upperLeftArm", "position" : { - "x" : -0.1165364086627960, - "y" : 0.9012566804885864 + "x" : -0.1165359988808632, + "y" : 0.9012569785118103 }, "type" : 2 }, @@ -74,35 +74,35 @@ { "x" : [ - 0.1570899933576584, - 0.1570899933576584, - -0.1156369969248772, - -0.1156369969248772 + 0.1366278976202011, + 0.1366278976202011, + -0.1360991001129150, + -0.1360991001129150 ], "y" : [ - -0.3584159910678864, - 0.4034900069236755, - 0.4034900069236755, - -0.3584159910678864 + -0.3788780868053436, + 0.3830279111862183, + 0.3830279111862183, + -0.3788780868053436 ] } } } ], "linearVelocity" : 0, - "massData-I" : 0.01153474114835262, + "massData-I" : 0.01134084537625313, "massData-center" : { - "x" : 0.02072649449110031, - "y" : 0.02253700792789459 + "x" : 0.0002643987536430359, + "y" : 0.002074912190437317 }, - "massData-mass" : 0.2077923268079758, + "massData-mass" : 0.2077923566102982, "name" : "chest", "position" : { - "x" : -0.02137973159551620, - "y" : 0.7773683071136475 + "x" : 0.0007875636219978333, + "y" : 0.7995355725288391 }, "type" : 2 }, @@ -216,35 +216,35 @@ { "x" : [ - 0.07039503753185272, - 0.07039503753185272, - -0.07039495557546616, - -0.07039495557546616 + 0.07039500027894974, + 0.07039500027894974, + -0.07039500027894974, + -0.07039500027894974 ], "y" : [ - -0.09294363856315613, - 0.1277718394994736, - 0.1277718394994736, - -0.09294363856315613 + -0.09294360131025314, + 0.1277720034122467, + 0.1277720034122467, + -0.09294360131025314 ] } } } ], "linearVelocity" : 0, - "massData-I" : 0.0001869033440016210, + "massData-I" : 0.0001869037223514169, "massData-center" : { - "x" : 4.097818973036738e-08, - "y" : 0.01741409860551357 + "x" : 0, + "y" : 0.01741420105099678 }, - "massData-mass" : 0.03107452951371670, + "massData-mass" : 0.03107454814016819, "name" : "lowerLeftLeg", "position" : { - "x" : -0.04570891708135605, - "y" : 0.09799571335315704 + "x" : -0.03829947486519814, + "y" : 0.09799569845199585 }, "type" : 2 }, @@ -320,33 +320,33 @@ [ 0.04693000018596649, 0.04693000018596649, - -0.04693005979061127, - -0.04693005979061127 + -0.04693010076880455, + -0.04693010076880455 ], "y" : [ - -0.1895973682403564, - 0.1895966529846191, - 0.1895966529846191, - -0.1895973682403564 + -0.1895969957113266, + 0.1895969957113266, + 0.1895969957113266, + -0.1895969957113266 ] } } } ], "linearVelocity" : 0, - "massData-I" : 0.0004525946278590709, + "massData-I" : 0.0004525947733782232, "massData-center" : { - "x" : -2.980232238769531e-08, - "y" : -3.576278686523438e-07 + "x" : -5.029141902923584e-08, + "y" : 0 }, - "massData-mass" : 0.03559117391705513, + "massData-mass" : 0.03559118881821632, "name" : "upperRightArm", "position" : { - "x" : 0.1183081120252609, - "y" : 0.9012566804885864 + "x" : 0.1183080002665520, + "y" : 0.9012569785118103 }, "type" : 2 }, @@ -396,8 +396,8 @@ "name" : "upperRightLeg", "position" : { - "x" : 0.04785731062293053, - "y" : 0.3325108885765076 + "x" : 0.03859551250934601, + "y" : 0.3325110077857971 }, "type" : 2 }, @@ -447,8 +447,8 @@ "name" : "upperLeftLeg", "position" : { - "x" : -0.04570891708135605, - "y" : 0.3325108885765076 + "x" : -0.03829947486519814, + "y" : 0.3325110077857971 }, "type" : 2 }, @@ -471,16 +471,16 @@ { "x" : [ - 0.07039496302604675, - 0.07039496302604675, - -0.07039486616849899, - -0.07039486616849899 + 0.07039500027894974, + 0.07039500027894974, + -0.07039490342140198, + -0.07039490342140198 ], "y" : [ -0.09294389933347702, - 0.1276105940341949, - 0.1276105940341949, + 0.1276109963655472, + 0.1276109963655472, -0.09294389933347702 ] } @@ -488,18 +488,18 @@ } ], "linearVelocity" : 0, - "massData-I" : 0.0001864957448560745, + "massData-I" : 0.0001864968799054623, "massData-center" : { "x" : 4.842877032729120e-08, - "y" : 0.01733334921300411 + "y" : 0.01733354665338993 }, - "massData-mass" : 0.03105182945728302, + "massData-mass" : 0.03105190023779869, "name" : "lowerRightLeg", "position" : { - "x" : 0.04785731062293053, - "y" : 0.09799571335315704 + "x" : 0.03859551250934601, + "y" : 0.09799569845199585 }, "type" : 2 } @@ -554,33 +554,183 @@ { "anchorA" : { - "x" : 0.02210754156112671, - "y" : 0.4607425928115845 + "x" : 0.0003538504242897034, + "y" : 0.07107692956924438 }, "anchorB" : { - "x" : -0.02544101513922215, - "y" : -0.2591779232025146 + "x" : 0.0003536641597747803, + "y" : -0.1459649801254272 }, - "bodyA" : 1, - "bodyB" : 2, + "bodyA" : 3, + "bodyB" : 6, "enableLimit" : true, "enableMotor" : false, "jointSpeed" : 0, - "lowerLimit" : -0.6981316804885864, - "maxMotorTorque" : 0, + "lowerLimit" : 0.01745329238474369, + "maxMotorTorque" : 1, "motorSpeed" : 0, - "name" : "joint9", + "name" : "joint1", "refAngle" : 0, "type" : "revolute", - "upperLimit" : 1.221730470657349 + "upperLimit" : 1.919862151145935 + }, + + { + "anchorA" : + { + "x" : -0.0007802955806255341, + "y" : -0.1484909951686859 + }, + "anchorB" : + { + "x" : -0.0007801018655300140, + "y" : 0.08614099025726318 + }, + "bodyA" : 8, + "bodyB" : 4, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0.01745329238474369, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint7", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 2.443460941314697 + }, + + { + "anchorA" : + { + "x" : -0.004979588091373444, + "y" : -0.1506859958171844 + }, + "anchorB" : + { + "x" : -0.005973689258098602, + "y" : 0.08482310175895691 + }, + "bodyA" : 7, + "bodyB" : 9, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0.01745329238474369, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint8", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 2.443460941314697 + }, + + { + "anchorA" : + { + "x" : -0.06799955666065216, + "y" : -0.3021813035011292 + }, + "anchorB" : + { + "x" : -0.02891255542635918, + "y" : 0.1648437976837158 + }, + "bodyA" : 1, + "bodyB" : 8, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.7853981852531433, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint6", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.570796370506287 + }, + + { + "anchorA" : + { + "x" : 0.06260262429714203, + "y" : -0.3029872477054596 + }, + "anchorB" : + { + "x" : 0.02294230461120605, + "y" : 0.1640380322933197 + }, + "bodyA" : 1, + "bodyB" : 7, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.7853981852531433, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint5", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.570796370506287 + }, + + { + "anchorA" : + { + "x" : 0.1179294362664223, + "y" : 0.2464744448661804 + }, + "anchorB" : + { + "x" : 0.0004089996218681335, + "y" : 0.1447530388832092 + }, + "bodyA" : 1, + "bodyB" : 6, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint2", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : -0.1188285648822784, + "y" : 0.2521644234657288 + }, + "anchorB" : + { + "x" : -0.001505002379417419, + "y" : 0.1504430174827576 + }, + "bodyA" : 1, + "bodyB" : 0, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint3", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 }, { "anchorA" : { "x" : 0.0008554458618164062, - "y" : -0.1461489200592041 + "y" : -0.1461489796638489 }, "anchorB" : { @@ -604,176 +754,26 @@ { "anchorA" : { - "x" : -0.09517394006252289, - "y" : 0.2718780040740967 + "x" : 0.02210754156112671, + "y" : 0.4607425332069397 }, "anchorB" : { - "x" : -1.741945743560791e-05, - "y" : 0.1479903459548950 + "x" : -0.02544101513922215, + "y" : -0.2591779232025146 }, "bodyA" : 1, - "bodyB" : 0, - "enableLimit" : false, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint3", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 3.141592741012573 - }, - - { - "anchorA" : - { - "x" : 0.1116365119814873, - "y" : -0.2944114208221436 - }, - "anchorB" : - { - "x" : 0.04127830639481544, - "y" : 0.1504460573196411 - }, - "bodyA" : 1, - "bodyB" : 7, + "bodyB" : 2, "enableLimit" : true, "enableMotor" : false, "jointSpeed" : 0, - "lowerLimit" : -0.7853981852531433, - "maxMotorTorque" : 1, + "lowerLimit" : -0.6981316804885864, + "maxMotorTorque" : 0, "motorSpeed" : 0, - "name" : "joint5", + "name" : "joint9", "refAngle" : 0, "type" : "revolute", - "upperLimit" : 1.570796370506287 - }, - - { - "anchorA" : - { - "x" : -0.06799929589033127, - "y" : -0.2890855073928833 - }, - "anchorB" : - { - "x" : -0.04493143409490585, - "y" : 0.1559127867221832 - }, - "bodyA" : 1, - "bodyB" : 8, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -0.7853981852531433, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint6", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 1.570796370506287 - }, - - { - "anchorA" : - { - "x" : 0.1396137326955795, - "y" : 0.2701327800750732 - }, - "anchorB" : - { - "x" : -7.455050945281982e-05, - "y" : 0.1462446451187134 - }, - "bodyA" : 1, - "bodyB" : 6, - "enableLimit" : false, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint2", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 3.141592741012573 - }, - - { - "anchorA" : - { - "x" : 0.0003538504242897034, - "y" : 0.07107692956924438 - }, - "anchorB" : - { - "x" : 0.0003536641597747803, - "y" : -0.1459646224975586 - }, - "bodyA" : 3, - "bodyB" : 6, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -1.919862151145935, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint1", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 0 - }, - - { - "anchorA" : - { - "x" : 0.001979876309633255, - "y" : -0.1506856828927994 - }, - "anchorB" : - { - "x" : 0.001979988068342209, - "y" : 0.08382888138294220 - }, - "bodyA" : 7, - "bodyB" : 9, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : 0.01745329238474369, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint8", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 2.268928050994873 - }, - - { - "anchorA" : - { - "x" : -0.0007802955806255341, - "y" : -0.1484908312559128 - }, - "anchorB" : - { - "x" : -0.0007801018655300140, - "y" : 0.08614097535610199 - }, - "bodyA" : 8, - "bodyB" : 4, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : 0.01745329238474369, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint7", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 2.268928050994873 + "upperLimit" : 1.221730470657349 } ], "positionIterations" : 3, diff --git a/app/Game/Client/GameObjects/Items/RubeDoll.js b/app/Game/Client/GameObjects/Items/RubeDoll.js index 4075560..659cd08 100644 --- a/app/Game/Client/GameObjects/Items/RubeDoll.js +++ b/app/Game/Client/GameObjects/Items/RubeDoll.js @@ -37,21 +37,21 @@ function (Parent, Layer, Settings, Nc) { }; limbOptions.upperRightLeg = { - width: 4, - height: 9, + width: 5, + height: 8, x: 2, y: limbOptions.chest.height / 2 }; limbOptions.lowerLeftLeg = { - width: 4, + width: 5, height: 4, x: -2, y: limbOptions.chest.height / 2 + limbOptions.upperLeftLeg.height }; limbOptions.lowerRightLeg = { - width: 4, + width: 5, height: 4, x: 2, y: limbOptions.chest.height / 2 + limbOptions.upperRightLeg.height @@ -60,28 +60,28 @@ function (Parent, Layer, Settings, Nc) { limbOptions.upperLeftArm = { - width: 2, + width: 4, height: 8, x: -2, y: -limbOptions.chest.height / 2 }; limbOptions.upperRightArm = { - width: 3, + width: 4, height: 8, x: 2, y: -limbOptions.chest.height / 2 }; limbOptions.lowerLeftArm = { - width: 2, + width: 4, height: 5, x: -2, y: -limbOptions.chest.height / 2 + limbOptions.upperLeftArm.height }; limbOptions.lowerRightArm = { - width: 2, + width: 4, height: 5, x: 2, y: -limbOptions.chest.height / 2 + limbOptions.upperRightArm.height @@ -93,7 +93,9 @@ function (Parent, Layer, Settings, Nc) { this.limbMeshes = {}; this.baseMeshName = "chest"; this.characterName = "Chuck"; - this.lastFlipDirection = 1; + this.lastFlipDirection = -options.direction || 1; + + console.log(this.lastFlipDirection); Parent.call(this, physicsEngine, uid, options); } @@ -187,22 +189,10 @@ function (Parent, Layer, Settings, Nc) { RubeDoll.prototype.flip = function(direction) { Parent.prototype.flip.call(this, direction); - if(this.limbs) { - for(var name in this.limbMeshes) { - if(this.limbs[name]) { - Nc.trigger(Nc.ns.client.view.mesh.update, - this.layerId, - this.limbMeshes[name], - { - xScale: direction, - } - ); - } - } - } + console.log("last", this.lastFlipDirection, "now", direction); // flipping depth of right body side arm/leg images with left - if (this.lastFlipDirection != direction) { + if (this.lastFlipDirection != direction) { // FIXME : this is a bit broken. this.lastFlipDirection = direction; @@ -226,6 +216,28 @@ function (Parent, Layer, Settings, Nc) { this.limbMeshes["upperRightArm"], this.limbMeshes["upperLeftArm"] ); + + // swap short images + Nc.trigger(Nc.ns.client.view.mesh.swapMeshes, + this.layerId, + this.limbMeshes["upperRightLeg"], + this.limbMeshes["upperLeftLeg"] + ); + } + + // x flipping has to happen after (see swapMeshes) + if(this.limbs) { + for(var name in this.limbMeshes) { + if(this.limbs[name]) { + Nc.trigger(Nc.ns.client.view.mesh.update, + this.layerId, + this.limbMeshes[name], + { + xScale: direction, + } + ); + } + } } }; diff --git a/app/Game/Core/GameObjects/Items/RubeDoll.js b/app/Game/Core/GameObjects/Items/RubeDoll.js index eeca209..f30d53b 100644 --- a/app/Game/Core/GameObjects/Items/RubeDoll.js +++ b/app/Game/Core/GameObjects/Items/RubeDoll.js @@ -33,7 +33,7 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { this.body.SetUserData(this); - this.flip(options.direction); + this.flip(options.direction || 1); } RubeDoll.prototype = Object.create(Parent.prototype); @@ -41,6 +41,8 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { RubeDoll.prototype.loadRubeDollFromScene = function(options) { var scene = this.rubeLoader.getScene(); + + for (var i in scene.bodies) { var body = scene.bodies[i]; var position = body.GetPosition().Copy(); @@ -50,6 +52,15 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { )); body.SetPosition(position); this.limbs[body.name] = body; + + // code snipped possibly needed for filtering between doll and rubedoll while holding + //var filterData = new Box2D.Dynamics.b2FilterData(); + //filterData.groupIndex = -66; + //if(body.name != "head" && body.name != "chest") { + // for (var fixture = body.GetFixtureList(); fixture; fixture = fixture.GetNext()) { + // fixture.SetFilterData(filterData); + // } + //} } this.joints = scene.joints; diff --git a/static/img/Characters/Chuck/lowerLeftArm.png b/static/img/Characters/Chuck/lowerLeftArm.png index fb43dd59175fcfebcd3dca2291122613ea36c273..85d7ac4412b399d8ecc004c79dc24fabfb2fbe2b 100755 GIT binary patch literal 2776 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 diff --git a/static/img/Characters/Chuck/lowerLeftLeg.png b/static/img/Characters/Chuck/lowerLeftLeg.png index 2314dec36b6188ab3cc3d75b3d971e0b9bbcd8b7..c7b08033680a286a9cc3d8bdc36a516a2a2f5eca 100755 GIT binary patch literal 2785 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 diff --git a/static/img/Characters/Chuck/lowerRightLeg.png b/static/img/Characters/Chuck/lowerRightLeg.png index 2314dec36b6188ab3cc3d75b3d971e0b9bbcd8b7..1d7c7b84646468e4d950126e23a3ba47ade1317e 100755 GIT binary patch literal 2785 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 v000$9L_t&t*JEHdU|52 literal 145 zcmeAS@N?(olHy`uVBq!ia0vp^OhC-R!3-pye7;uzq$EpRBT9nv(@M${i&7aJQ}UBi z6+Ckj(^G>|6H_V+Po~-c74Zl7gt(rW9lfn5B)ZrqIMdZH+39lb$Gbo&2~QWtkcwML p2}wx_X-Nr*X$dI~ZVZfU42%T~VlyIFr2^G3c)I$ztaD0e0suQdDv|&I diff --git a/static/img/Characters/Chuck/upperRightArm.png b/static/img/Characters/Chuck/upperRightArm.png index 44bf6cf377ca6cbfbff29fc6266ae4dacaf2203e..cd31fce6edd8b1a0593d41d21a1641a5df94f97a 100755 GIT binary patch literal 2793 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 v000$9L_t&t*JEHdU|RF{JKv}kuAirQB z_y2!}&HI<^2a3pex;TbZ+)7GFN=i*gN=!>gOiN2hNO3*Rz{tkH!opzfwtcTFP#uG( LtDnm{r-UW|_~$iM diff --git a/static/img/Characters/Chuck/upperRightLeg.png b/static/img/Characters/Chuck/upperRightLeg.png index 11b5f29c66ae3bf70477490c169d71d5140a1595..c8ab6d672e92ce12394be286afaf522729a5738d 100644 GIT binary patch delta 2805 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 literal 2866 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 diff --git a/static/items/rube/ragdoll.rube b/static/items/rube/ragdoll.rube index 7024172..bbe7d2d 100644 --- a/static/items/rube/ragdoll.rube +++ b/static/items/rube/ragdoll.rube @@ -84,16 +84,16 @@ { "x" : [ - 0.07039496302604675, - 0.07039496302604675, - -0.07039486616849899, - -0.07039486616849899 + 0.07039500027894974, + 0.07039500027894974, + -0.07039490342140198, + -0.07039490342140198 ], "y" : [ -0.09294389933347702, - 0.1276105940341949, - 0.1276105940341949, + 0.1276109963655472, + 0.1276109963655472, -0.09294389933347702 ] } @@ -101,18 +101,18 @@ ], "id" : 1, "linearVelocity" : 0, - "massData-I" : 0.0001864957448560745, + "massData-I" : 0.0001864968799054623, "massData-center" : { "x" : 4.842877032729120e-08, - "y" : 0.01733334921300411 + "y" : 0.01733354665338993 }, - "massData-mass" : 0.03105182945728302, + "massData-mass" : 0.03105190023779869, "name" : "lowerRightLeg", "position" : { - "x" : 0.04785731062293053, - "y" : 0.09799571335315704 + "x" : 0.03859551250934601, + "y" : 0.09799569845199585 }, "type" : "dynamic" }, @@ -168,8 +168,8 @@ "name" : "upperLeftLeg", "position" : { - "x" : -0.04570891708135605, - "y" : 0.3325108885765076 + "x" : -0.03829947486519814, + "y" : 0.3325110077857971 }, "type" : "dynamic" }, @@ -225,8 +225,8 @@ "name" : "upperRightLeg", "position" : { - "x" : 0.04785731062293053, - "y" : 0.3325108885765076 + "x" : 0.03859551250934601, + "y" : 0.3325110077857971 }, "type" : "dynamic" }, @@ -257,33 +257,33 @@ [ 0.04693000018596649, 0.04693000018596649, - -0.04693005979061127, - -0.04693005979061127 + -0.04693010076880455, + -0.04693010076880455 ], "y" : [ - -0.1895973682403564, - 0.1895966529846191, - 0.1895966529846191, - -0.1895973682403564 + -0.1895969957113266, + 0.1895969957113266, + 0.1895969957113266, + -0.1895969957113266 ] } } ], "id" : 4, "linearVelocity" : 0, - "massData-I" : 0.0004525946278590709, + "massData-I" : 0.0004525947733782232, "massData-center" : { - "x" : -2.980232238769531e-08, - "y" : -3.576278686523438e-07 + "x" : -5.029141902923584e-08, + "y" : 0 }, - "massData-mass" : 0.03559117391705513, + "massData-mass" : 0.03559118881821632, "name" : "upperRightArm", "position" : { - "x" : 0.1183081120252609, - "y" : 0.9012566804885864 + "x" : 0.1183080002665520, + "y" : 0.9012569785118103 }, "type" : "dynamic" }, @@ -369,35 +369,35 @@ { "x" : [ - 0.07039503753185272, - 0.07039503753185272, - -0.07039495557546616, - -0.07039495557546616 + 0.07039500027894974, + 0.07039500027894974, + -0.07039500027894974, + -0.07039500027894974 ], "y" : [ - -0.09294363856315613, - 0.1277718394994736, - 0.1277718394994736, - -0.09294363856315613 + -0.09294360131025314, + 0.1277720034122467, + 0.1277720034122467, + -0.09294360131025314 ] } } ], "id" : 6, "linearVelocity" : 0, - "massData-I" : 0.0001869033440016210, + "massData-I" : 0.0001869037223514169, "massData-center" : { - "x" : 4.097818973036738e-08, - "y" : 0.01741409860551357 + "x" : 0, + "y" : 0.01741420105099678 }, - "massData-mass" : 0.03107452951371670, + "massData-mass" : 0.03107454814016819, "name" : "lowerLeftLeg", "position" : { - "x" : -0.04570891708135605, - "y" : 0.09799571335315704 + "x" : -0.03829947486519814, + "y" : 0.09799569845199585 }, "type" : "dynamic" }, @@ -529,35 +529,35 @@ { "x" : [ - -0.1156369969248772, - 0.1570899933576584, - 0.1570899933576584, - -0.1156369969248772 + -0.1360991001129150, + 0.1366278976202011, + 0.1366278976202011, + -0.1360991001129150 ], "y" : [ - -0.3584159910678864, - -0.3584159910678864, - 0.4034900069236755, - 0.4034900069236755 + -0.3788780868053436, + -0.3788780868053436, + 0.3830279111862183, + 0.3830279111862183 ] } } ], "id" : 9, "linearVelocity" : 0, - "massData-I" : 0.01153474114835262, + "massData-I" : 0.01134084537625313, "massData-center" : { - "x" : 0.02072649449110031, - "y" : 0.02253700792789459 + "x" : 0.0002643987536430359, + "y" : 0.002074912190437317 }, - "massData-mass" : 0.2077923268079758, + "massData-mass" : 0.2077923566102982, "name" : "chest", "position" : { - "x" : -0.02137973159551620, - "y" : 0.7773683071136475 + "x" : 0.0007875636219978333, + "y" : 0.7995355725288391 }, "type" : "dynamic" }, @@ -586,17 +586,17 @@ { "x" : [ - 0.04692991077899933, - 0.04692991077899933, - -0.04692997038364410, - -0.04692997038364410 + 0.04692989960312843, + 0.04692989960312843, + -0.04693000018596649, + -0.04693000018596649 ], "y" : [ - -0.1895973682403564, - 0.1895966529846191, - 0.1895966529846191, - -0.1895973682403564 + -0.1895969957113266, + 0.1895969957113266, + 0.1895969957113266, + -0.1895969957113266 ] } } @@ -606,15 +606,15 @@ "massData-I" : 0.0004525936674326658, "massData-center" : { - "x" : -2.980232238769531e-08, - "y" : -3.576278686523438e-07 + "x" : -5.029141902923584e-08, + "y" : 0 }, "massData-mass" : 0.03559110686182976, "name" : "upperLeftArm", "position" : { - "x" : -0.1165364086627960, - "y" : 0.9012566804885864 + "x" : -0.1165359988808632, + "y" : 0.9012569785118103 }, "type" : "dynamic" } @@ -625,13 +625,13 @@ { "anchorA" : { - "x" : -0.0007802955806255341, - "y" : -0.1484908312559128 + "x" : -0.0007802959880791605, + "y" : -0.1484909951686859 }, "anchorB" : { - "x" : -0.0007801018655300140, - "y" : 0.08614096790552139 + "x" : -0.0007801019819453359, + "y" : 0.08614099770784378 }, "bodyA" : 2, "bodyB" : 6, @@ -645,19 +645,19 @@ "name" : "joint7", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 2.268928050994873 + "upperLimit" : 2.443460941314697 }, { "anchorA" : { - "x" : 0.001979876309633255, - "y" : -0.1506856828927994 + "x" : -0.004979589954018593, + "y" : -0.1506859958171844 }, "anchorB" : { - "x" : 0.001979988068342209, - "y" : 0.08382887393236160 + "x" : -0.005973690189421177, + "y" : 0.08482310175895691 }, "bodyA" : 3, "bodyB" : 1, @@ -671,7 +671,7 @@ "name" : "joint8", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 2.268928050994873 + "upperLimit" : 2.443460941314697 }, { @@ -682,8 +682,8 @@ }, "anchorB" : { - "x" : 0.0003536641597747803, - "y" : -0.1459646224975586 + "x" : 0.0003536640142556280, + "y" : -0.1459649950265884 }, "bodyA" : 7, "bodyB" : 4, @@ -691,25 +691,25 @@ "enableLimit" : true, "enableMotor" : false, "id" : 3, - "lowerLimit" : -1.919862151145935, + "lowerLimit" : 0.01745329238474369, "maxMotorTorque" : 1, "motorSpeed" : 0, "name" : "joint1", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 0 + "upperLimit" : 1.919862151145935 }, { "anchorA" : { - "x" : 0.1396137326955795, - "y" : 0.2701327204704285 + "x" : 0.1179294362664223, + "y" : 0.2464744448661804 }, "anchorB" : { - "x" : -7.455050945281982e-05, - "y" : 0.1462445855140686 + "x" : 0.0004089996218681335, + "y" : 0.1447530388832092 }, "bodyA" : 9, "bodyB" : 4, @@ -729,13 +729,13 @@ { "anchorA" : { - "x" : -0.06799929589033127, - "y" : -0.2890855073928833 + "x" : -0.06799955666065216, + "y" : -0.3021813035011292 }, "anchorB" : { - "x" : -0.04493143782019615, - "y" : 0.1559127867221832 + "x" : -0.02891255542635918, + "y" : 0.1648437976837158 }, "bodyA" : 9, "bodyB" : 2, @@ -755,13 +755,13 @@ { "anchorA" : { - "x" : 0.1116365119814873, - "y" : -0.2944114208221436 + "x" : 0.06260262429714203, + "y" : -0.3029872477054596 }, "anchorB" : { - "x" : 0.04127831012010574, - "y" : 0.1504460573196411 + "x" : 0.02294230461120605, + "y" : 0.1640380322933197 }, "bodyA" : 9, "bodyB" : 3, @@ -781,13 +781,13 @@ { "anchorA" : { - "x" : -0.09517394006252289, - "y" : 0.2718779444694519 + "x" : -0.1188285648822784, + "y" : 0.2521644234657288 }, "anchorB" : { - "x" : -1.741945743560791e-05, - "y" : 0.1479902863502502 + "x" : -0.001505002379417419, + "y" : 0.1504430174827576 }, "bodyA" : 9, "bodyB" : 10, @@ -807,8 +807,8 @@ { "anchorA" : { - "x" : 0.0008554458618164062, - "y" : -0.1461489200592041 + "x" : 0.0008554459782317281, + "y" : -0.1461489945650101 }, "anchorB" : { From 97da7770d0b89fc47431d4c5b05758ceca9bb669 Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 20 Apr 2015 15:31:25 +0200 Subject: [PATCH 17/68] repaired debug view (offsetting) --- app/Game/Client/View/Pixi/Layers/Debug.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/app/Game/Client/View/Pixi/Layers/Debug.js b/app/Game/Client/View/Pixi/Layers/Debug.js index c7ae643..c5b650e 100644 --- a/app/Game/Client/View/Pixi/Layers/Debug.js +++ b/app/Game/Client/View/Pixi/Layers/Debug.js @@ -16,12 +16,5 @@ function (Parent, PIXI) { Debug.prototype = Object.create(Parent.prototype); - Debug.prototype.render = function(centerPosition, zoom) { - Parent.prototype.render.call(this, centerPosition, zoom); - - this.container.x -= 300 * zoom; - this.container.y -= 200 * zoom; - }; - return new Debug(); }); \ No newline at end of file From da62339a95276b116cc260f99b0b4ed9ada733e1 Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 20 Apr 2015 15:58:41 +0200 Subject: [PATCH 18/68] rebuilt skateboard without joints --- app/Game/Core/GameObjects/Items/Skateboard.js | 133 +++++++++++++++--- app/Game/Core/Loader/Level.js | 4 +- 2 files changed, 118 insertions(+), 19 deletions(-) diff --git a/app/Game/Core/GameObjects/Items/Skateboard.js b/app/Game/Core/GameObjects/Items/Skateboard.js index e6124c9..ae4e00a 100755 --- a/app/Game/Core/GameObjects/Items/Skateboard.js +++ b/app/Game/Core/GameObjects/Items/Skateboard.js @@ -12,16 +12,114 @@ function (Parent, Box2D, Settings, Assert) { function Skateboard(physicsEngine, uid, options) { Parent.call(this, physicsEngine, uid, options); + } + + Skateboard.prototype = Object.create(Parent.prototype); + + Skateboard.prototype.createFixture = function () { + Assert.number(this.options.width, this.options.height); + Assert.number(this.options.weight); + + var deckShape = new Box2D.Collision.Shapes.b2PolygonShape(); + var w = this.options.width / Settings.RATIO; + var h = 2 / Settings.RATIO; + deckShape.SetAsOrientedBox(w / 2, h / 2, new Box2D.Common.Math.b2Vec2(0, -(4.5 / Settings.RATIO))); + + var fixtureDef = new Box2D.Dynamics.b2FixtureDef(); + fixtureDef.shape = deckShape; + + var offset = 4, + factor = 80; + var density = ((this.options.weight + offset) / this.options.width / this.options.height) * factor; + fixtureDef.density = density; + fixtureDef.friction = Settings.ITEM_FRICTION; + fixtureDef.restitution = 0.2; + fixtureDef.isSensor = false; + + this.body.CreateFixture(fixtureDef); + + + this.addWheel( + -8, + -2.5 + ); + + this.addWheel( + 7, + -2.5 + ); + + }; + + + + Skateboard.prototype.addWheel = function(x, y) { + Assert.number(x, y); + + var bodyDef = new Box2D.Dynamics.b2BodyDef(); + bodyDef.type = Box2D.Dynamics.b2Body.b2_dynamicBody; + bodyDef.position.x = x / Settings.RATIO; + bodyDef.position.y = y / Settings.RATIO; + bodyDef.angle = 0; + + var wheelShape = new Box2D.Collision.Shapes.b2CircleShape(); + wheelShape.SetRadius(2.5 / Settings.RATIO); + wheelShape.SetLocalPosition(new Box2D.Common.Math.b2Vec2(x / Settings.RATIO, y / Settings.RATIO)); + + + var fixtureDef = new Box2D.Dynamics.b2FixtureDef(); + var offset = 4, + factor = 80; + var density = ((0.1 + offset) / 3 / 3) * factor; + fixtureDef.density = density; + fixtureDef.shape = wheelShape; + fixtureDef.restitution = 0.2; + fixtureDef.isSensor = false; + fixtureDef.friction = 0.0005; + + this.body.CreateFixture(fixtureDef); + }; + + + + Skateboard.prototype.flip = function(direction) { + this.flipDirection = direction; + + // FIXME: implement body flip if necessary + }; + + + + return Skateboard; + +}); + + +/* +define([ + "Game/" + GLOBALS.context + "/GameObjects/Item", + "Lib/Vendor/Box2D", + "Game/Config/Settings", + "Lib/Utilities/Assert" +], + +function (Parent, Box2D, Settings, Assert) { + + "use strict"; + + function Skateboard(physicsEngine, uid, options) { + + Parent.call(this, physicsEngine, uid, options); this.wheels = [ - this.addWheel( - options.x + 8, - options.y - 1.5 - ), - this.addWheel( - options.x - 8, - options.y - 1.5 - ) + this.addWheel( + options.x + 8, + options.y - 1.5 + ), + this.addWheel( + options.x - 8, + options.y - 1.5 + ) ]; } @@ -53,13 +151,13 @@ function (Parent, Box2D, Settings, Assert) { Skateboard.prototype.addWheel = function(x, y) { Assert.number(x, y); - var bodyDef = new Box2D.Dynamics.b2BodyDef(); + var bodyDef = new Box2D.Dynamics.b2BodyDef(); bodyDef.type = Box2D.Dynamics.b2Body.b2_dynamicBody; bodyDef.position.x = x / Settings.RATIO; bodyDef.position.y = y / Settings.RATIO; bodyDef.angle = 0; - var wheelShape = new Box2D.Collision.Shapes.b2CircleShape(); + var wheelShape = new Box2D.Collision.Shapes.b2CircleShape(); wheelShape.SetRadius(1.5 / Settings.RATIO); wheelShape.SetLocalPosition(new Box2D.Common.Math.b2Vec2(0, 0)); @@ -75,18 +173,18 @@ function (Parent, Box2D, Settings, Assert) { var wheelBody = this.body.GetWorld().CreateBody(bodyDef); wheelBody.CreateFixture(fixtureDef); - //var revoluteJointDef = new Box2D.Dynamics.Joints.b2RevoluteJointDef(); + //var revoluteJointDef = new Box2D.Dynamics.Joints.b2RevoluteJointDef(); var revoluteJointDef = new Box2D.Dynamics.Joints.b2WeldJointDef(); - //revoluteJointDef.enableMotor = false; + //revoluteJointDef.enableMotor = false; - revoluteJointDef.Initialize(this.body, wheelBody, wheelBody.GetWorldCenter()); - var j = this.body.GetWorld().CreateJoint(revoluteJointDef); + revoluteJointDef.Initialize(this.body, wheelBody, wheelBody.GetWorldCenter()); + var j = this.body.GetWorld().CreateJoint(revoluteJointDef); - // FIXME this means, that we will have bodies in the world, which must not be - // updated (wheels) because they are always connected to a body which will be updated. + // FIXME this means, that we will have bodies in the world, which must not be + // updated (wheels) because they are always connected to a body which will be updated. return wheelBody; }; @@ -116,4 +214,5 @@ function (Parent, Box2D, Settings, Assert) { return Skateboard; -}); \ No newline at end of file +}); +*/ \ No newline at end of file diff --git a/app/Game/Core/Loader/Level.js b/app/Game/Core/Loader/Level.js index 84b0c68..53b43d8 100755 --- a/app/Game/Core/Loader/Level.js +++ b/app/Game/Core/Loader/Level.js @@ -46,8 +46,8 @@ define([ Level.prototype.createItem = function(uid, options) { switch(options.type) { - //case "skateboard": - // return new Skateboard(this.engine, uid, options); + case "skateboard": + return new Skateboard(this.engine, uid, options); case "ragdoll": return new RagDoll(this.engine, uid, options); case "rube": From 287b5e0e18468a3da2d8b81b58412f7f3f46a71f Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 20 Apr 2015 15:59:07 +0200 Subject: [PATCH 19/68] added skateboard to debug --- static/maps/tiled/debug.json | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/static/maps/tiled/debug.json b/static/maps/tiled/debug.json index ae3b19d..8c48f07 100644 --- a/static/maps/tiled/debug.json +++ b/static/maps/tiled/debug.json @@ -221,11 +221,11 @@ }, "rotation":0, - "type":"", + "type":"rube", "visible":true, "width":0, "x":236.607333333333, - "y":471.255333333333 + "y":462.255333333333 }, { "height":0, @@ -286,6 +286,21 @@ "width":0, "x":464, "y":357 + }, + { + "height":0, + "id":15, + "name":"Skateboard", + "properties": + { + + }, + "rotation":0, + "type":"", + "visible":true, + "width":0, + "x":206, + "y":183 }], "opacity":1, "type":"objectgroup", From 1546136303129c25af5e5478144bf18fa0c823cb Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 20 Apr 2015 16:00:07 +0200 Subject: [PATCH 20/68] rebuilt skateboard without joints --- app/Game/Core/GameObjects/Items/Skateboard.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/Game/Core/GameObjects/Items/Skateboard.js b/app/Game/Core/GameObjects/Items/Skateboard.js index ae4e00a..1e12df6 100755 --- a/app/Game/Core/GameObjects/Items/Skateboard.js +++ b/app/Game/Core/GameObjects/Items/Skateboard.js @@ -51,8 +51,6 @@ function (Parent, Box2D, Settings, Assert) { }; - - Skateboard.prototype.addWheel = function(x, y) { Assert.number(x, y); @@ -80,15 +78,9 @@ function (Parent, Box2D, Settings, Assert) { this.body.CreateFixture(fixtureDef); }; - - Skateboard.prototype.flip = function(direction) { this.flipDirection = direction; - - // FIXME: implement body flip if necessary }; - - return Skateboard; From ca1ca7635b49dfefedba935a6a7bb4dadab7dd84 Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 20 Apr 2015 21:20:56 +0200 Subject: [PATCH 21/68] implemented rubedoll level item (not after dying yet) --- app/Game/Asset/RubeDoll.json | 788 +++++++++ .../Items/{Rube.js => RubeDoll.js} | 2 +- app/Game/Client/GameObjects/Items/Rube.js | 28 - app/Game/Client/GameObjects/Items/RubeDoll.js | 187 +++ app/Game/Config/ItemSettings.js | 12 +- app/Game/Core/GameObjects/Items/Rube.js | 1412 ----------------- app/Game/Core/GameObjects/Items/RubeDoll.js | 66 + app/Game/Core/Loader/Level.js | 8 +- app/Lib/Vendor/RequireJs/Plugin/Json.js | 72 + app/Lib/Vendor/RequireJs/Plugin/Text.js | 391 +++++ channel.js | 6 +- client.js | 2 + config/build-profile.js | 2 + static/items/rube/ragdoll-full.json | 1346 ++++++++++++++++ static/items/rube/ragdoll.rube | 828 ++++------ static/maps/tiled/debug.json | 12 +- 16 files changed, 3140 insertions(+), 2022 deletions(-) create mode 100644 app/Game/Asset/RubeDoll.json rename app/Game/Channel/GameObjects/Items/{Rube.js => RubeDoll.js} (63%) delete mode 100644 app/Game/Client/GameObjects/Items/Rube.js create mode 100644 app/Game/Client/GameObjects/Items/RubeDoll.js delete mode 100644 app/Game/Core/GameObjects/Items/Rube.js create mode 100644 app/Game/Core/GameObjects/Items/RubeDoll.js create mode 100644 app/Lib/Vendor/RequireJs/Plugin/Json.js create mode 100644 app/Lib/Vendor/RequireJs/Plugin/Text.js create mode 100644 static/items/rube/ragdoll-full.json diff --git a/app/Game/Asset/RubeDoll.json b/app/Game/Asset/RubeDoll.json new file mode 100644 index 0000000..114e29f --- /dev/null +++ b/app/Game/Asset/RubeDoll.json @@ -0,0 +1,788 @@ + +{ + "allowSleep" : true, + "autoClearForces" : true, + "body" : + [ + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.04692991077899933, + 0.04692991077899933, + -0.04692997038364410, + -0.04692997038364410 + ], + "y" : + [ + -0.1895973682403564, + 0.1895966529846191, + 0.1895966529846191, + -0.1895973682403564 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0004525936674326658, + "massData-center" : + { + "x" : -2.980232238769531e-08, + "y" : -3.576278686523438e-07 + }, + "massData-mass" : 0.03559110686182976, + "name" : "upperLeftArm", + "position" : + { + "x" : -0.1362041532993317, + "y" : 0.9068759679794312 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture0", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.1402979493141174, + 0.1375417709350586, + 0.001378186047077179, + -0.1402979493141174, + -0.1402979493141174, + 0.001192390918731689 + ], + "y" : + [ + -0.3207050263881683, + 0.4018019437789917, + 0.4018019437789917, + 0.3136067390441895, + -0.3432337343692780, + -0.3689299821853638 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.01047351956367493, + "massData-center" : + { + "x" : 0.001456731930375099, + "y" : 0.01425695233047009 + }, + "massData-mass" : 0.2038488984107971, + "name" : "chest", + "position" : + { + "x" : -0.04104747623205185, + "y" : 0.7829875946044922 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "circle" : + { + "center" : + { + "x" : -0.002679032273590565, + "y" : 0.004700660705566406 + }, + "radius" : 0.2268356680870056 + }, + "density" : 0.2204959988594055, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture1" + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0009180362685583532, + "massData-center" : + { + "x" : -0.002679032273590565, + "y" : 0.004700660705566406 + }, + "massData-mass" : 0.03564291819930077, + "name" : "head", + "position" : + { + "x" : 0.009572610259056091, + "y" : 1.462979435920715 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.04693000018596649, + 0.04693000018596649, + -0.04693005979061127, + -0.04693005979061127 + ], + "y" : + [ + -0.1159216761589050, + 0.1159217953681946, + 0.1159217953681946, + -0.1159216761589050 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0001134485355578363, + "massData-center" : + { + "x" : -2.980232238769531e-08, + "y" : 5.960464477539062e-08 + }, + "massData-mass" : 0.02176084183156490, + "name" : "lowerRightArm", + "position" : + { + "x" : 0.09864036738872528, + "y" : 0.6898344159126282 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.07039503753185272, + 0.07039503753185272, + -0.07039495557546616, + -0.07039495557546616 + ], + "y" : + [ + -0.09294363856315613, + 0.1277718394994736, + 0.1277718394994736, + -0.09294363856315613 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0001869033440016210, + "massData-center" : + { + "x" : 4.097818973036738e-08, + "y" : 0.01741409860551357 + }, + "massData-mass" : 0.03107452951371670, + "name" : "lowerLeftLeg", + "position" : + { + "x" : -0.06537666171789169, + "y" : 0.1036150008440018 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.04693000763654709, + 0.04693000763654709, + -0.04692991077899933, + -0.04692991077899933 + ], + "y" : + [ + -0.1159216761589050, + 0.1159217953681946, + 0.1159217953681946, + -0.1159216761589050 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0001134483172791079, + "massData-center" : + { + "x" : 4.842877032729120e-08, + "y" : 5.960464477539062e-08 + }, + "massData-mass" : 0.02176081016659737, + "name" : "lowerLeftArm", + "position" : + { + "x" : -0.1362059414386749, + "y" : 0.6898344159126282 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.04693000018596649, + 0.04693000018596649, + -0.04693005979061127, + -0.04693005979061127 + ], + "y" : + [ + -0.1895973682403564, + 0.1895966529846191, + 0.1895966529846191, + -0.1895973682403564 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0004525946278590709, + "massData-center" : + { + "x" : -2.980232238769531e-08, + "y" : -3.576278686523438e-07 + }, + "massData-mass" : 0.03559117391705513, + "name" : "upperRightArm", + "position" : + { + "x" : 0.09864036738872528, + "y" : 0.9068759679794312 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.07039496302604675, + 0.07039496302604675, + -0.07039486616849899, + -0.07039486616849899 + ], + "y" : + [ + -0.1890522241592407, + 0.1890524625778198, + 0.1890524625778198, + -0.1890522241592407 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0007221315754577518, + "massData-center" : + { + "x" : 4.842877388000488e-08, + "y" : 1.192092895507812e-07 + }, + "massData-mass" : 0.05323329567909241, + "name" : "upperRightLeg", + "position" : + { + "x" : 0.02818956598639488, + "y" : 0.3381301760673523 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.07039505988359451, + 0.07039505988359451, + -0.07039495557546616, + -0.07039495557546616 + ], + "y" : + [ + -0.1890522241592407, + 0.1890524625778198, + 0.1890524625778198, + -0.1890522241592407 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.000722132739610970, + "massData-center" : + { + "x" : 5.215406417846680e-08, + "y" : 1.192092824453539e-07 + }, + "massData-mass" : 0.05323336645960808, + "name" : "upperLeftLeg", + "position" : + { + "x" : -0.06537666171789169, + "y" : 0.3381301760673523 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.07039496302604675, + 0.07039496302604675, + -0.07039486616849899, + -0.07039486616849899 + ], + "y" : + [ + -0.09294389933347702, + 0.1276105940341949, + 0.1276105940341949, + -0.09294389933347702 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0001864957448560745, + "massData-center" : + { + "x" : 4.842877032729120e-08, + "y" : 0.01733334921300411 + }, + "massData-mass" : 0.03105182945728302, + "name" : "lowerRightLeg", + "position" : + { + "x" : 0.02818956598639488, + "y" : 0.1036150008440018 + }, + "type" : 2 + } + ], + "collisionbitplanes" : + { + "names" : + [ + "bitplane1", + "bitplane2", + "bitplane3", + "bitplane4", + "bitplane5", + "bitplane6", + "bitplane7", + "bitplane8", + "bitplane9", + "bitplane10", + "bitplane11", + "bitplane12", + "bitplane13", + "bitplane14", + "bitplane15", + "bitplane16", + "bitplane17", + "bitplane18", + "bitplane19", + "bitplane20", + "bitplane21", + "bitplane22", + "bitplane23", + "bitplane24", + "bitplane25", + "bitplane26", + "bitplane27", + "bitplane28", + "bitplane29", + "bitplane30", + "bitplane31", + "bitplane32" + ] + }, + "continuousPhysics" : true, + "gravity" : + { + "x" : 0, + "y" : -10 + }, + "joint" : + [ + + { + "anchorA" : + { + "x" : 0.06392270326614380, + "y" : 0.4330990314483643 + }, + "anchorB" : + { + "x" : 0.01330260001122952, + "y" : -0.2468919754028320 + }, + "bodyA" : 1, + "bodyB" : 2, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.6981316804885864, + "maxMotorTorque" : 0, + "motorSpeed" : 0, + "name" : "joint9", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.221730470657349 + }, + + { + "anchorA" : + { + "x" : 0.0008554458618164062, + "y" : -0.1461489200592041 + }, + "anchorB" : + { + "x" : 0.0008557140827178955, + "y" : 0.07089227437973022 + }, + "bodyA" : 0, + "bodyB" : 5, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -1.919862151145935, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint4", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 0.01745329238474369 + }, + + { + "anchorA" : + { + "x" : 0.0003538504242897034, + "y" : 0.07107692956924438 + }, + "anchorB" : + { + "x" : 0.0003536641597747803, + "y" : -0.1459646224975586 + }, + "bodyA" : 3, + "bodyB" : 6, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -1.919862151145935, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint1", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 0.01745329238474369 + }, + + { + "anchorA" : + { + "x" : 0.001979876309633255, + "y" : -0.1506856828927994 + }, + "anchorB" : + { + "x" : 0.001979988068342209, + "y" : 0.08382888138294220 + }, + "bodyA" : 7, + "bodyB" : 9, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0.01745329238474369, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint8", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 2.268928050994873 + }, + + { + "anchorA" : + { + "x" : -0.0007802918553352356, + "y" : -0.1484908312559128 + }, + "anchorB" : + { + "x" : -0.0007800981402397156, + "y" : 0.08614097535610199 + }, + "bodyA" : 8, + "bodyB" : 4, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0.01745329238474369, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint7", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 2.268928050994873 + }, + + { + "anchorA" : + { + "x" : -0.09517393261194229, + "y" : 0.2718780040740967 + }, + "anchorB" : + { + "x" : -1.741945743560791e-05, + "y" : 0.1479903459548950 + }, + "bodyA" : 1, + "bodyB" : 0, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint3", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : 0.1396137326955795, + "y" : 0.2701327800750732 + }, + "anchorB" : + { + "x" : -7.455050945281982e-05, + "y" : 0.1462446451187134 + }, + "bodyA" : 1, + "bodyB" : 6, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint2", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : -0.06799929589033127, + "y" : -0.2890855073928833 + }, + "anchorB" : + { + "x" : -0.04493143409490585, + "y" : 0.1559127867221832 + }, + "bodyA" : 1, + "bodyB" : 8, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.6981316804885864, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint6", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.919862151145935 + }, + + { + "anchorA" : + { + "x" : 0.1116365119814873, + "y" : -0.2944114208221436 + }, + "anchorB" : + { + "x" : 0.04127830639481544, + "y" : 0.1504460573196411 + }, + "bodyA" : 1, + "bodyB" : 7, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.6981316804885864, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint5", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.919862151145935 + } + ], + "positionIterations" : 3, + "stepsPerSecond" : 60.0, + "subStepping" : false, + "velocityIterations" : 8, + "warmStarting" : true +} diff --git a/app/Game/Channel/GameObjects/Items/Rube.js b/app/Game/Channel/GameObjects/Items/RubeDoll.js similarity index 63% rename from app/Game/Channel/GameObjects/Items/Rube.js rename to app/Game/Channel/GameObjects/Items/RubeDoll.js index 455467b..3e27b2b 100644 --- a/app/Game/Channel/GameObjects/Items/Rube.js +++ b/app/Game/Channel/GameObjects/Items/RubeDoll.js @@ -1,5 +1,5 @@ define([ - "Game/Core/GameObjects/Items/Rube" + "Game/Core/GameObjects/Items/RubeDoll" ], function (Parent) { diff --git a/app/Game/Client/GameObjects/Items/Rube.js b/app/Game/Client/GameObjects/Items/Rube.js deleted file mode 100644 index 4aa825b..0000000 --- a/app/Game/Client/GameObjects/Items/Rube.js +++ /dev/null @@ -1,28 +0,0 @@ -define([ - "Game/Core/GameObjects/Items/Rube" -], - -function (Parent) { - - "use strict"; - - function Rube(physicsEngine, uid, options) { - Parent.call(this, physicsEngine, uid, options); - } - - Rube.prototype = Object.create(Parent.prototype); - - Rube.prototype.createMesh = function() { - }; - - Rube.prototype.destroy = function() { - }; - - Rube.prototype.render = function() { - } - - Rube.prototype.flip = function(direction) { - }; - - return Rube; -}); \ No newline at end of file diff --git a/app/Game/Client/GameObjects/Items/RubeDoll.js b/app/Game/Client/GameObjects/Items/RubeDoll.js new file mode 100644 index 0000000..2c76d91 --- /dev/null +++ b/app/Game/Client/GameObjects/Items/RubeDoll.js @@ -0,0 +1,187 @@ +define([ + "Game/Core/GameObjects/Items/RubeDoll", + "Game/Client/View/Abstract/Layer", + "Game/Config/Settings", + "Lib/Utilities/NotificationCenter", +], + +function (Parent, Layer, Settings, Nc) { + + "use strict"; + + function RubeDoll(physicsEngine, uid, options) { + + this.primaryColor = 0x008800; + + var limbOptions = {}; + + limbOptions.chest = { + width: 6, + height: 18, + x: 0, + y: 0 + }; + + limbOptions.head = { + width: 10, + height: 12, + x: 0, + y: - limbOptions.chest.height / 2 - 7 + }; + + limbOptions.upperLeftLeg = { + width: 5, + height: 8, + x: -2, + y: limbOptions.chest.height / 2 + }; + + limbOptions.upperRightLeg = { + width: 4, + height: 9, + x: 2, + y: limbOptions.chest.height / 2 + }; + + limbOptions.lowerLeftLeg = { + width: 4, + height: 4, + x: -2, + y: limbOptions.chest.height / 2 + limbOptions.upperLeftLeg.height + }; + + limbOptions.lowerRightLeg = { + width: 4, + height: 4, + x: 2, + y: limbOptions.chest.height / 2 + limbOptions.upperRightLeg.height + }; + + + + limbOptions.upperLeftArm = { + width: 2, + height: 8, + x: -2, + y: -limbOptions.chest.height / 2 + }; + + limbOptions.upperRightArm = { + width: 3, + height: 8, + x: 2, + y: -limbOptions.chest.height / 2 + }; + + limbOptions.lowerLeftArm = { + width: 2, + height: 5, + x: -2, + y: -limbOptions.chest.height / 2 + limbOptions.upperLeftArm.height + }; + + limbOptions.lowerRightArm = { + width: 2, + height: 5, + x: 2, + y: -limbOptions.chest.height / 2 + limbOptions.upperRightArm.height + }; + + this.limbOptions = limbOptions; + + this.layerId = Layer.ID.SPAWN; + this.limbMeshes = {}; + this.baseMeshName = "chest"; + this.characterName = "Chuck"; + + Parent.call(this, physicsEngine, uid, options); + } + + RubeDoll.prototype = Object.create(Parent.prototype); + + RubeDoll.prototype.createMesh = function() { + + + this.createLimbMesh("lowerRightLeg"); + this.createLimbMesh("upperRightLeg"); + + this.createLimbMesh("lowerRightArm"); + this.createLimbMesh("upperRightArm"); + + this.createLimbMesh("chest"); + this.createLimbMesh("head"); + + this.createLimbMesh("lowerLeftLeg"); + this.createLimbMesh("upperLeftLeg"); + + this.createLimbMesh("lowerLeftArm"); + this.createLimbMesh("upperLeftArm"); + + }; + + RubeDoll.prototype.createLimbMesh = function(name) { + var self = this; + var texturePath = Settings.GRAPHICS_PATH + + Settings.GRAPHICS_SUBPATH_CHARACTERS + "" + + this.characterName + '/'; + + + var callback = function(mesh) { + if(name == self.baseMeshName) { + self.mesh = mesh; + } + + self.limbMeshes[name] = mesh; + + Nc.trigger(Nc.ns.client.view.mesh.add, self.layerId, mesh); + + // setting shirt color + Nc.trigger(Nc.ns.client.view.mesh.addFilter, self.layerId, mesh, "colorRangeReplace", { + minColor: 0x3b4a31, + maxColor: 0x6d855d, + newColor: self.primaryColor, + brightnessOffset: 0.56 + }); + }; + + Nc.trigger(Nc.ns.client.view.mesh.create, + this.layerId, + texturePath + name + ".png", + callback, + { + width: this.limbOptions[name].width, + height: this.limbOptions[name].height, + pivot: { + x: this.limbOptions[name].width / 2, + y: this.limbOptions[name].height / 2 + } + } + ); + }; + + RubeDoll.prototype.destroy = function() { + }; + + RubeDoll.prototype.render = function() { + if(this.limbs) { + for(var name in this.limbMeshes) { + if(this.limbs[name]) { + Nc.trigger(Nc.ns.client.view.mesh.update, + this.layerId, + this.limbMeshes[name], + { + x: this.limbs[name].GetPosition().x * Settings.RATIO, + y: this.limbs[name].GetPosition().y * Settings.RATIO, + rotation: this.limbs[name].GetAngle() + } + ); + } + } + } + }; + + RubeDoll.prototype.flip = function(direction) { + }; + + return RubeDoll; +}); \ No newline at end of file diff --git a/app/Game/Config/ItemSettings.js b/app/Game/Config/ItemSettings.js index 0546123..532d6fc 100644 --- a/app/Game/Config/ItemSettings.js +++ b/app/Game/Config/ItemSettings.js @@ -411,19 +411,17 @@ function () { }, - - - "Rube": + "RubeDoll": { "category": "kitchen", "image": "banana.gif", - - // "type": "rube", - "weight": "1", + + "weight": "3", "width": "5", "height": "9", - "grabAngle": "0.5", + "type": "rubedoll", + "grabAngle": "0", } }; diff --git a/app/Game/Core/GameObjects/Items/Rube.js b/app/Game/Core/GameObjects/Items/Rube.js deleted file mode 100644 index ccc06a6..0000000 --- a/app/Game/Core/GameObjects/Items/Rube.js +++ /dev/null @@ -1,1412 +0,0 @@ -define([ - "Game/" + GLOBALS.context + "/GameObjects/Item", - "Lib/Vendor/RubeLoader", - "Lib/Vendor/Box2D", - "Game/Config/Settings", - "Lib/Utilities/Assert" -], - -function (Parent, RubeLoader, Box2D, Settings, Assert) { - - "use strict"; - - // Fixme - make this loadable - var __ragdollJson; - - function Rube(physicsEngine, uid, options) { - Assert.number(options.x, options.y); - - this.rubeLoader = null; - this.body = null; - - Parent.call(this, physicsEngine, uid, options); - var world = physicsEngine.getWorld(); - world.DestroyBody(this.body); - - var json = __ragdollJson; - - this.rubeLoader = new RubeLoader(json, world); - var scene = this.rubeLoader.getScene(); - - for (var i in scene.bodies) { - var body = scene.bodies[i]; - var position = body.GetPosition().Copy(); - position.Add(new Box2D.Common.Math.b2Vec2( - options.x / Settings.RATIO, - options.y / Settings.RATIO - )); - body.SetPosition(position); - - if(body.name == "chest"){ - this.body = body; - } - } - - var def = this.body.GetDefinition(); - def.userData = this; - this.body.SetUserData(this); - } - - Rube.prototype = Object.create(Parent.prototype); - - Rube.prototype.flip = function(direction) { - Parent.prototype.flip.call(this, direction); - // Extend - }; - - __ragdollJson = - -{ - "allowSleep" : true, - "autoClearForces" : true, - "body" : - [ - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.05748672783374786, - 0.05748672783374786, - -0.05748683214187622, - -0.05748683214187622 - ], - "y" : - [ - -0.2322469353675842, - 0.2322462797164917, - 0.2322462797164917, - -0.2322469353675842 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.001019014045596123, - "massData-center" : - { - "x" : -5.215406062575312e-08, - "y" : -3.278255462646484e-07 - }, - "massData-mass" : 0.05340443924069405, - "name" : "upperArmLeft", - "position" : - { - "x" : -0.1699507087469101, - "y" : 1.113796472549438 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture0", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.1718577891588211, - 0.1684816330671310, - 0.001688212156295776, - -0.1718577295541763, - -0.1718577295541763, - 0.001460619270801544 - ], - "y" : - [ - -0.3928470611572266, - 0.4921868443489075, - 0.4921868443489075, - 0.3841522336006165, - -0.4204435348510742, - -0.4519201517105103 - ] - } - } - }, - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture2", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.1679489463567734, - 0.1679489463567734, - -0.004204027354717255, - -0.004204027354717255 - ], - "y" : - [ - 0.4449140429496765, - 0.6170670390129089, - 0.6170670390129089, - 0.4449140429496765 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.03228222951292992, - "massData-center" : - { - "x" : 0.008858840912580490, - "y" : 0.06282533705234528 - }, - "massData-mass" : 0.3355117142200470, - "name" : "chest", - "position" : - { - "x" : -0.05338868126273155, - "y" : 0.9620395302772522 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "circle" : - { - "center" : - { - "x" : -0.007499951869249344, - "y" : 0.003749847412109375 - }, - "radius" : 0.2746430933475494 - }, - "density" : 0.2204959988594055, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture1" - }, - - { - "circle" : - { - "center" : - { - "x" : -0.03327952325344086, - "y" : -0.1384725570678711 - }, - "radius" : 0.2485582530498505 - }, - "density" : 0.2204959988594055, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture1" - } - ], - "linearVelocity" : 0, - "massData-I" : 0.004164268728345633, - "massData-center" : - { - "x" : -0.01910765282809734, - "y" : -0.06028826907277107 - }, - "massData-mass" : 0.09504657238721848, - "name" : "head", - "position" : - { - "x" : 0.04257059469819069, - "y" : 1.812389135360718 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.05748683214187622, - 0.05748683214187622, - -0.05748690664768219, - -0.05748690664768219 - ], - "y" : - [ - -0.1419981122016907, - 0.1419981718063354, - 0.1419981718063354, - -0.1419981122016907 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0002554289239924401, - "massData-center" : - { - "x" : -3.725290298461914e-08, - "y" : 2.980232238769531e-08 - }, - "massData-mass" : 0.03265211358666420, - "name" : "lowerArmRight", - "position" : - { - "x" : 0.1177217364311218, - "y" : 0.8479318022727966 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.1415265351533890, - 0.1415265351533890, - -0.08457186818122864, - -0.08457186818122864 - ], - "y" : - [ - -0.1143886670470238, - -0.05680520832538605, - -0.05680520832538605, - -0.1143886670470238 - ] - } - } - }, - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.08623030036687851, - 0.08623030036687851, - -0.08623020350933075, - -0.08623020350933075 - ], - "y" : - [ - -0.1138511821627617, - 0.1565139442682266, - 0.1565139442682266, - -0.1138511821627617 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0005858240183442831, - "massData-center" : - { - "x" : 0.006215983536094427, - "y" : -0.002008607611060143 - }, - "massData-mass" : 0.05964682996273041, - "name" : "lowerLegLeft", - "position" : - { - "x" : -0.08319067955017090, - "y" : 0.1298431605100632 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.05748684704303741, - 0.05748684704303741, - -0.05748672783374786, - -0.05748672783374786 - ], - "y" : - [ - -0.1419981122016907, - 0.1419981718063354, - 0.1419981718063354, - -0.1419981122016907 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0002554284874349833, - "massData-center" : - { - "x" : 5.960464477539062e-08, - "y" : 2.980232238769531e-08 - }, - "massData-mass" : 0.03265206888318062, - "name" : "lowerArmLeft", - "position" : - { - "x" : -0.1699528992176056, - "y" : 0.8479318022727966 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.05748683214187622, - 0.05748683214187622, - -0.05748690664768219, - -0.05748690664768219 - ], - "y" : - [ - -0.2322469353675842, - 0.2322462797164917, - 0.2322462797164917, - -0.2322469353675842 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.001019015791825950, - "massData-center" : - { - "x" : -3.725290298461914e-08, - "y" : -3.278255462646484e-07 - }, - "massData-mass" : 0.05340452119708061, - "name" : "upperArmRight", - "position" : - { - "x" : 0.1177217364311218, - "y" : 1.113796472549438 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.08623021841049194, - 0.08623021841049194, - -0.08623008430004120, - -0.08623008430004120 - ], - "y" : - [ - -0.2315792292356491, - 0.2315795421600342, - 0.2315795421600342, - -0.2315792292356491 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.001625877106562257, - "massData-center" : - { - "x" : 6.705522537231445e-08, - "y" : 1.564621925354004e-07 - }, - "massData-mass" : 0.07987650483846664, - "name" : "upperLegRight", - "position" : - { - "x" : 0.03142313286662102, - "y" : 0.4171121716499329 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.08623032271862030, - 0.08623032271862030, - -0.08623017370700836, - -0.08623017370700836 - ], - "y" : - [ - -0.2315792292356491, - 0.2315795421600342, - 0.2315795421600342, - -0.2315792292356491 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.001625879434868693, - "massData-center" : - { - "x" : 7.450580596923828e-08, - "y" : 1.564621925354004e-07 - }, - "massData-mass" : 0.07987659424543381, - "name" : "upperLegLeft", - "position" : - { - "x" : -0.08319067955017090, - "y" : 0.4171121716499329 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.08623021841049194, - 0.08623021841049194, - -0.08623008430004120, - -0.08623008430004120 - ], - "y" : - [ - -0.1138515025377274, - 0.1563164740800858, - 0.1563164740800858, - -0.1138515025377274 - ] - } - } - }, - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.1415264606475830, - 0.1415264606475830, - -0.08457189798355103, - -0.08457189798355103 - ], - "y" : - [ - -0.1143886670470238, - -0.05680520832538605, - -0.05680520832538605, - -0.1143886670470238 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0005849063745699823, - "massData-center" : - { - "x" : 0.006219535600394011, - "y" : -0.002099231118336320 - }, - "massData-mass" : 0.05961277708411217, - "name" : "lowerLegRight", - "position" : - { - "x" : 0.03142313286662102, - "y" : 0.1298431605100632 - }, - "type" : 2 - } - ], - "collisionbitplanes" : - { - "names" : - [ - "bitplane1", - "bitplane2", - "bitplane3", - "bitplane4", - "bitplane5", - "bitplane6", - "bitplane7", - "bitplane8", - "bitplane9", - "bitplane10", - "bitplane11", - "bitplane12", - "bitplane13", - "bitplane14", - "bitplane15", - "bitplane16", - "bitplane17", - "bitplane18", - "bitplane19", - "bitplane20", - "bitplane21", - "bitplane22", - "bitplane23", - "bitplane24", - "bitplane25", - "bitplane26", - "bitplane27", - "bitplane28", - "bitplane29", - "bitplane30", - "bitplane31", - "bitplane32" - ] - }, - "continuousPhysics" : true, - "gravity" : - { - "x" : 0, - "y" : -10 - }, - "image" : - [ - - { - "aspectScale" : 1, - "body" : 9, - "center" : - { - "x" : 0.02911517955362797, - "y" : -0.0009155124425888062 - }, - "corners" : - { - "x" : - [ - -0.08536797016859055, - 0.1435983330011368, - 0.1435983330011368, - -0.08536797016859055 - ], - "y" : - [ - -0.1153986603021622, - -0.1153986603021622, - 0.1135676354169846, - 0.1135676354169846 - ] - }, - "file" : "../../img/Characters/Chuck/lowerLeftLeg.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.08536797016859055, - -0.1153986603021622, - 0.1435983330011368, - -0.1153986603021622, - 0.1435983330011368, - 0.1135676354169846, - -0.08536797016859055, - 0.1135676354169846 - ], - "name" : "image5", - "opacity" : 1, - "scale" : 0.2289662957191467 - }, - - { - "aspectScale" : 1, - "body" : 7, - "center" : - { - "x" : -0.02732392773032188, - "y" : 0.02671334147453308 - }, - "corners" : - { - "x" : - [ - -0.1425068378448486, - 0.08785898983478546, - 0.08785898983478546, - -0.1425068378448486 - ], - "y" : - [ - -0.2324482202529907, - -0.2324482202529907, - 0.2858749032020569, - 0.2858749032020569 - ] - }, - "file" : "../../img/Characters/Chuck/upperRightLeg.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.1425068378448486, - -0.2324482202529907, - 0.08785898983478546, - -0.2324482202529907, - 0.08785898983478546, - 0.2858749032020569, - -0.1425068378448486, - 0.2858749032020569 - ], - "name" : "image6", - "opacity" : 1, - "scale" : 0.5183231234550476 - }, - - { - "aspectScale" : 1, - "body" : 6, - "center" : - { - "x" : 0.0003027096390724182, - "y" : 0.0006600618362426758 - }, - "corners" : - { - "x" : - [ - -0.05836960300803185, - 0.05897502228617668, - 0.05897502228617668, - -0.05836960300803185 - ], - "y" : - [ - -0.2340291887521744, - -0.2340291887521744, - 0.2353493124246597, - 0.2353493124246597 - ] - }, - "file" : "../../img/Characters/Chuck/upperLeftArm.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.05836960300803185, - -0.2340291887521744, - 0.05897502228617668, - -0.2340291887521744, - 0.05897502228617668, - 0.2353493124246597, - -0.05836960300803185, - 0.2353493124246597 - ], - "name" : "image4", - "opacity" : 1, - "renderOrder" : 1, - "scale" : 0.4693785011768341 - }, - - { - "aspectScale" : 1, - "body" : 3, - "center" : - { - "x" : 0.0007003694772720337, - "y" : 0.001779437065124512 - }, - "corners" : - { - "x" : - [ - -0.05596264451742172, - 0.05736338347196579, - 0.05736338347196579, - -0.05596264451742172 - ], - "y" : - [ - -0.1398780941963196, - -0.1398780941963196, - 0.1434369683265686, - 0.1434369683265686 - ] - }, - "file" : "../../img/Characters/Chuck/lowerLeftArm.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.05596264451742172, - -0.1398780941963196, - 0.05736338347196579, - -0.1398780941963196, - 0.05736338347196579, - 0.1434369683265686, - -0.05596264451742172, - 0.1434369683265686 - ], - "name" : "image3", - "opacity" : 1, - "renderOrder" : 1, - "scale" : 0.2833150625228882 - }, - - { - "aspectScale" : 1, - "body" : 1, - "center" : - { - "x" : -0.0008481591939926147, - "y" : -0.001265347003936768 - }, - "corners" : - { - "x" : - [ - -0.1698881536722183, - 0.1681918352842331, - 0.1681918352842331, - -0.1698881536722183 - ], - "y" : - [ - -0.480212002992630, - -0.480212002992630, - 0.4776813089847565, - 0.4776813089847565 - ] - }, - "file" : "../../img/Characters/Chuck/chest.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.1698881536722183, - -0.480212002992630, - 0.1681918352842331, - -0.480212002992630, - 0.1681918352842331, - 0.4776813089847565, - -0.1698881536722183, - 0.4776813089847565 - ], - "name" : "image2", - "opacity" : 1, - "renderOrder" : 5, - "scale" : 0.9578933119773865 - }, - - { - "aspectScale" : 1, - "body" : 8, - "center" : - { - "x" : 0.003173574805259705, - "y" : -0.001172244548797607 - }, - "corners" : - { - "x" : - [ - -0.1414211541414261, - 0.1477683037519455, - 0.1477683037519455, - -0.1414211541414261 - ], - "y" : - [ - -0.2325238138437271, - -0.2325238138437271, - 0.2301793247461319, - 0.2301793247461319 - ] - }, - "file" : "../../img/Characters/Chuck/upperLeftLeg.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.1414211541414261, - -0.2325238138437271, - 0.1477683037519455, - -0.2325238138437271, - 0.1477683037519455, - 0.2301793247461319, - -0.1414211541414261, - 0.2301793247461319 - ], - "name" : "image6", - "opacity" : 1, - "renderOrder" : 6, - "scale" : 0.4627031385898590 - }, - - { - "aspectScale" : 1, - "body" : 4, - "center" : - { - "x" : 0.02851789817214012, - "y" : -0.0009155124425888062 - }, - "corners" : - { - "x" : - [ - -0.08596524596214294, - 0.1430010497570038, - 0.1430010497570038, - -0.08596524596214294 - ], - "y" : - [ - -0.1153986603021622, - -0.1153986603021622, - 0.1135676354169846, - 0.1135676354169846 - ] - }, - "file" : "../../img/Characters/Chuck/lowerLeftLeg.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.08596524596214294, - -0.1153986603021622, - 0.1430010497570038, - -0.1153986603021622, - 0.1430010497570038, - 0.1135676354169846, - -0.08596524596214294, - 0.1135676354169846 - ], - "name" : "image5", - "opacity" : 1, - "renderOrder" : 6, - "scale" : 0.2289662957191467 - }, - - { - "aspectScale" : 1, - "body" : 2, - "center" : - { - "x" : 0.01975236460566521, - "y" : -0.07194232940673828 - }, - "corners" : - { - "x" : - [ - -0.2679373621940613, - 0.3074420690536499, - 0.3074420690536499, - -0.2679373621940613 - ], - "y" : - [ - -0.4171699881553650, - -0.4171699881553650, - 0.2732853293418884, - 0.2732853293418884 - ] - }, - "file" : "../../img/Characters/Chuck/head.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.2679373621940613, - -0.4171699881553650, - 0.3074420690536499, - -0.4171699881553650, - 0.3074420690536499, - 0.2732853293418884, - -0.2679373621940613, - 0.2732853293418884 - ], - "name" : "image1", - "opacity" : 1, - "renderOrder" : 6, - "scale" : 0.6904553174972534 - }, - - { - "aspectScale" : 1, - "body" : 0, - "center" : - { - "x" : 0.002138927578926086, - "y" : 0.0006600618362426758 - }, - "corners" : - { - "x" : - [ - -0.05653338506817818, - 0.06081124022603035, - 0.06081124022603035, - -0.05653338506817818 - ], - "y" : - [ - -0.2340291887521744, - -0.2340291887521744, - 0.2353493124246597, - 0.2353493124246597 - ] - }, - "file" : "../../img/Characters/Chuck/upperLeftArm.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.05653338506817818, - -0.2340291887521744, - 0.06081124022603035, - -0.2340291887521744, - 0.06081124022603035, - 0.2353493124246597, - -0.05653338506817818, - 0.2353493124246597 - ], - "name" : "image4", - "opacity" : 1, - "renderOrder" : 8, - "scale" : 0.4693785011768341 - }, - - { - "aspectScale" : 1, - "body" : 5, - "center" : - { - "x" : 0.002538725733757019, - "y" : 0.001779437065124512 - }, - "corners" : - { - "x" : - [ - -0.05412428826093674, - 0.05920173972845078, - 0.05920173972845078, - -0.05412428826093674 - ], - "y" : - [ - -0.1398780941963196, - -0.1398780941963196, - 0.1434369683265686, - 0.1434369683265686 - ] - }, - "file" : "../../img/Characters/Chuck/lowerLeftArm.png", - "filter" : 0, - "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], - "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], - "glVertexPointer" : - [ - -0.05412428826093674, - -0.1398780941963196, - 0.05920173972845078, - -0.1398780941963196, - 0.05920173972845078, - 0.1434369683265686, - -0.05412428826093674, - 0.1434369683265686 - ], - "name" : "image3", - "opacity" : 1, - "renderOrder" : 8, - "scale" : 0.2833150625228882 - } - ], - "joint" : - [ - - { - "anchorA" : - { - "x" : 0.001047849655151367, - "y" : -0.1790249347686768 - }, - "anchorB" : - { - "x" : 0.001048207283020020, - "y" : 0.08683943748474121 - }, - "bodyA" : 0, - "bodyB" : 5, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : 0, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint4", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 1.919862151145935 - }, - - { - "anchorA" : - { - "x" : -0.1165831685066223, - "y" : 0.3330366015434265 - }, - "anchorB" : - { - "x" : -2.135336399078369e-05, - "y" : 0.1812803745269775 - }, - "bodyA" : 1, - "bodyB" : 0, - "enableLimit" : false, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint3", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 3.141592741012573 - }, - - { - "anchorA" : - { - "x" : 0.07454992830753326, - "y" : 0.5068108439445496 - }, - "anchorB" : - { - "x" : -0.02141102217137814, - "y" : -0.3435407876968384 - }, - "bodyA" : 1, - "bodyB" : 2, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -1.221730470657349, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint0", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 0.6981316804885864 - }, - - { - "anchorA" : - { - "x" : 0.1367489844560623, - "y" : -0.3606387376785278 - }, - "anchorB" : - { - "x" : 0.05056380107998848, - "y" : 0.1842886805534363 - }, - "bodyA" : 1, - "bodyB" : 7, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -0.6981316804885864, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint5", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 1.919862151145935 - }, - - { - "anchorA" : - { - "x" : -0.08329562842845917, - "y" : -0.3541148304939270 - }, - "anchorB" : - { - "x" : -0.05503869056701660, - "y" : 0.1909851431846619 - }, - "bodyA" : 1, - "bodyB" : 8, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -0.6981316804885864, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint6", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 1.919862151145935 - }, - - { - "anchorA" : - { - "x" : 0.1710196435451508, - "y" : 0.3308989405632019 - }, - "anchorB" : - { - "x" : -9.131431579589844e-05, - "y" : 0.1791421175003052 - }, - "bodyA" : 1, - "bodyB" : 6, - "enableLimit" : false, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint2", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 3.141592741012573 - }, - - { - "anchorA" : - { - "x" : 0.0004334598779678345, - "y" : 0.08706557750701904 - }, - "anchorB" : - { - "x" : 0.0004332214593887329, - "y" : -0.1787990331649780 - }, - "bodyA" : 3, - "bodyB" : 6, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : 0, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint1", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 1.919862151145935 - }, - - { - "anchorA" : - { - "x" : 0.002425249665975571, - "y" : -0.1845821887254715 - }, - "anchorB" : - { - "x" : 0.002425376325845718, - "y" : 0.1026860624551773 - }, - "bodyA" : 7, - "bodyB" : 9, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint8", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 0 - }, - - { - "anchorA" : - { - "x" : -0.0009558200836181641, - "y" : -0.1818936169147491 - }, - "anchorB" : - { - "x" : -0.0009555891156196594, - "y" : 0.1055182516574860 - }, - "bodyA" : 8, - "bodyB" : 4, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint7", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 0 - } - ], - "positionIterations" : 3, - "stepsPerSecond" : 60.0, - "subStepping" : false, - "velocityIterations" : 8, - "warmStarting" : true -}; - - - - - - - return Rube; - -}); \ No newline at end of file diff --git a/app/Game/Core/GameObjects/Items/RubeDoll.js b/app/Game/Core/GameObjects/Items/RubeDoll.js new file mode 100644 index 0000000..ad3323e --- /dev/null +++ b/app/Game/Core/GameObjects/Items/RubeDoll.js @@ -0,0 +1,66 @@ +define([ + "Game/" + GLOBALS.context + "/GameObjects/Item", + "Lib/Vendor/RubeLoader", + "Lib/Vendor/Box2D", + "Game/Config/Settings", + "Lib/Utilities/Assert", + "json!Game/Asset/RubeDoll.json" // using requirejs json loader plugin +], + +function (Parent, RubeLoader, Box2D, Settings, Assert, RubeDollJson) { + + "use strict"; + + function RubeDoll(physicsEngine, uid, options) { + Assert.number(options.x, options.y); + + this.rubeLoader = null; + this.body = null; + this.limbs = {}; + + var chest = null; + var world = physicsEngine.getWorld(); + this.rubeLoader = new RubeLoader(RubeDollJson, world); + var scene = this.rubeLoader.getScene(); + + for (var i in scene.bodies) { + var body = scene.bodies[i]; + var position = body.GetPosition().Copy(); + position.Add(new Box2D.Common.Math.b2Vec2( + options.x / Settings.RATIO, + options.y / Settings.RATIO + )); + body.SetPosition(position); + this.limbs[body.name] = body; + } + + Parent.call(this, physicsEngine, uid, options); + world.DestroyBody(this.body); + this.body = this.limbs.chest; + + var def = this.body.GetDefinition(); + def.userData = this; + this.body.SetUserData(this); + } + + RubeDoll.prototype = Object.create(Parent.prototype); + + RubeDoll.prototype.flip = function(direction) { + Parent.prototype.flip.call(this, direction); + // Extend + }; + + RubeDoll.prototype.reposition = function(handPosition, direction) { + + Parent.prototype.reposition.call(this, handPosition, direction); + + var position = new Box2D.Common.Math.b2Vec2( + handPosition.x + ((6 / Settings.RATIO) * direction), + handPosition.y + ); + + this.body.SetPosition(position); + }; + + return RubeDoll; +}); \ No newline at end of file diff --git a/app/Game/Core/Loader/Level.js b/app/Game/Core/Loader/Level.js index 53b43d8..bd49a20 100755 --- a/app/Game/Core/Loader/Level.js +++ b/app/Game/Core/Loader/Level.js @@ -8,9 +8,9 @@ define([ "Game/" + GLOBALS.context + "/GameObjects/Item", "Game/" + GLOBALS.context + "/GameObjects/Items/Skateboard", "Game/" + GLOBALS.context + "/GameObjects/Items/RagDoll", - "Game/" + GLOBALS.context + "/GameObjects/Items/Rube" + "Game/" + GLOBALS.context + "/GameObjects/Items/RubeDoll" -], function (Settings, Box2D, Nc, Abstract, CollisionDetector, Tile, Item, Skateboard, RagDoll, Rube) { +], function (Settings, Box2D, Nc, Abstract, CollisionDetector, Tile, Item, Skateboard, RagDoll, RubeDoll) { "use strict"; @@ -50,8 +50,8 @@ define([ return new Skateboard(this.engine, uid, options); case "ragdoll": return new RagDoll(this.engine, uid, options); - case "rube": - return new Rube(this.engine, uid, options); + case "rubedoll": + return new RubeDoll(this.engine, uid, options); default: return new Item(this.engine, uid, options); } diff --git a/app/Lib/Vendor/RequireJs/Plugin/Json.js b/app/Lib/Vendor/RequireJs/Plugin/Json.js new file mode 100644 index 0000000..f62f568 --- /dev/null +++ b/app/Lib/Vendor/RequireJs/Plugin/Json.js @@ -0,0 +1,72 @@ +/** @license + * RequireJS plugin for loading JSON files + * - depends on Text plugin and it was HEAVILY "inspired" by it as well. + * Author: Miller Medeiros + * Version: 0.4.0 (2014/04/10) + * Released under the MIT license + */ +define(['text'], function(text){ + + var CACHE_BUST_QUERY_PARAM = 'bust', + CACHE_BUST_FLAG = '!bust', + jsonParse = (typeof JSON !== 'undefined' && typeof JSON.parse === 'function')? JSON.parse : function(val){ + return eval('('+ val +')'); //quick and dirty + }, + buildMap = {}; + + function cacheBust(url){ + url = url.replace(CACHE_BUST_FLAG, ''); + url += (url.indexOf('?') < 0)? '?' : '&'; + return url + CACHE_BUST_QUERY_PARAM +'='+ Math.round(2147483647 * Math.random()); + } + + //API + return { + + load : function(name, req, onLoad, config) { + if (( config.isBuild && (config.inlineJSON === false || name.indexOf(CACHE_BUST_QUERY_PARAM +'=') !== -1)) || (req.toUrl(name).indexOf('empty:') === 0)) { + //avoid inlining cache busted JSON or if inlineJSON:false + //and don't inline files marked as empty! + onLoad(null); + } else { + text.get(req.toUrl(name), function(data){ + var parsed; + if (config.isBuild) { + buildMap[name] = data; + onLoad(data); + } else { + try { + parsed = jsonParse(data); + } catch (e) { + onLoad.error(e); + } + onLoad(parsed); + } + }, + onLoad.error, { + accept: 'application/json' + } + ); + } + }, + + normalize : function (name, normalize) { + // used normalize to avoid caching references to a "cache busted" request + if (name.indexOf(CACHE_BUST_FLAG) !== -1) { + name = cacheBust(name); + } + // resolve any relative paths + return normalize(name); + }, + + //write method based on RequireJS official text plugin by James Burke + //https://github.com/jrburke/requirejs/blob/master/text.js + write : function(pluginName, moduleName, write){ + if(moduleName in buildMap){ + var content = buildMap[moduleName]; + write('define("'+ pluginName +'!'+ moduleName +'", function(){ return '+ content +';});\n'); + } + } + + }; +}); \ No newline at end of file diff --git a/app/Lib/Vendor/RequireJs/Plugin/Text.js b/app/Lib/Vendor/RequireJs/Plugin/Text.js new file mode 100644 index 0000000..148c553 --- /dev/null +++ b/app/Lib/Vendor/RequireJs/Plugin/Text.js @@ -0,0 +1,391 @@ +/** + * @license RequireJS text 2.0.14 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/requirejs/text for details + */ +/*jslint regexp: true */ +/*global require, XMLHttpRequest, ActiveXObject, + define, window, process, Packages, + java, location, Components, FileUtils */ + +define(['module'], function (module) { + 'use strict'; + + var text, fs, Cc, Ci, xpcIsWindows, + progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'], + xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, + bodyRegExp = /]*>\s*([\s\S]+)\s*<\/body>/im, + hasLocation = typeof location !== 'undefined' && location.href, + defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\:/, ''), + defaultHostName = hasLocation && location.hostname, + defaultPort = hasLocation && (location.port || undefined), + buildMap = {}, + masterConfig = (module.config && module.config()) || {}; + + text = { + version: '2.0.14', + + strip: function (content) { + //Strips declarations so that external SVG and XML + //documents can be added to a document without worry. Also, if the string + //is an HTML document, only the part inside the body tag is returned. + if (content) { + content = content.replace(xmlRegExp, ""); + var matches = content.match(bodyRegExp); + if (matches) { + content = matches[1]; + } + } else { + content = ""; + } + return content; + }, + + jsEscape: function (content) { + return content.replace(/(['\\])/g, '\\$1') + .replace(/[\f]/g, "\\f") + .replace(/[\b]/g, "\\b") + .replace(/[\n]/g, "\\n") + .replace(/[\t]/g, "\\t") + .replace(/[\r]/g, "\\r") + .replace(/[\u2028]/g, "\\u2028") + .replace(/[\u2029]/g, "\\u2029"); + }, + + createXhr: masterConfig.createXhr || function () { + //Would love to dump the ActiveX crap in here. Need IE 6 to die first. + var xhr, i, progId; + if (typeof XMLHttpRequest !== "undefined") { + return new XMLHttpRequest(); + } else if (typeof ActiveXObject !== "undefined") { + for (i = 0; i < 3; i += 1) { + progId = progIds[i]; + try { + xhr = new ActiveXObject(progId); + } catch (e) {} + + if (xhr) { + progIds = [progId]; // so faster next time + break; + } + } + } + + return xhr; + }, + + /** + * Parses a resource name into its component parts. Resource names + * look like: module/name.ext!strip, where the !strip part is + * optional. + * @param {String} name the resource name + * @returns {Object} with properties "moduleName", "ext" and "strip" + * where strip is a boolean. + */ + parseName: function (name) { + var modName, ext, temp, + strip = false, + index = name.lastIndexOf("."), + isRelative = name.indexOf('./') === 0 || + name.indexOf('../') === 0; + + if (index !== -1 && (!isRelative || index > 1)) { + modName = name.substring(0, index); + ext = name.substring(index + 1); + } else { + modName = name; + } + + temp = ext || modName; + index = temp.indexOf("!"); + if (index !== -1) { + //Pull off the strip arg. + strip = temp.substring(index + 1) === "strip"; + temp = temp.substring(0, index); + if (ext) { + ext = temp; + } else { + modName = temp; + } + } + + return { + moduleName: modName, + ext: ext, + strip: strip + }; + }, + + xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/, + + /** + * Is an URL on another domain. Only works for browser use, returns + * false in non-browser environments. Only used to know if an + * optimized .js version of a text resource should be loaded + * instead. + * @param {String} url + * @returns Boolean + */ + useXhr: function (url, protocol, hostname, port) { + var uProtocol, uHostName, uPort, + match = text.xdRegExp.exec(url); + if (!match) { + return true; + } + uProtocol = match[2]; + uHostName = match[3]; + + uHostName = uHostName.split(':'); + uPort = uHostName[1]; + uHostName = uHostName[0]; + + return (!uProtocol || uProtocol === protocol) && + (!uHostName || uHostName.toLowerCase() === hostname.toLowerCase()) && + ((!uPort && !uHostName) || uPort === port); + }, + + finishLoad: function (name, strip, content, onLoad) { + content = strip ? text.strip(content) : content; + if (masterConfig.isBuild) { + buildMap[name] = content; + } + onLoad(content); + }, + + load: function (name, req, onLoad, config) { + //Name has format: some.module.filext!strip + //The strip part is optional. + //if strip is present, then that means only get the string contents + //inside a body tag in an HTML string. For XML/SVG content it means + //removing the declarations so the content can be inserted + //into the current doc without problems. + + // Do not bother with the work if a build and text will + // not be inlined. + if (config && config.isBuild && !config.inlineText) { + onLoad(); + return; + } + + masterConfig.isBuild = config && config.isBuild; + + var parsed = text.parseName(name), + nonStripName = parsed.moduleName + + (parsed.ext ? '.' + parsed.ext : ''), + url = req.toUrl(nonStripName), + useXhr = (masterConfig.useXhr) || + text.useXhr; + + // Do not load if it is an empty: url + if (url.indexOf('empty:') === 0) { + onLoad(); + return; + } + + //Load the text. Use XHR if possible and in a browser. + if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) { + text.get(url, function (content) { + text.finishLoad(name, parsed.strip, content, onLoad); + }, function (err) { + if (onLoad.error) { + onLoad.error(err); + } + }); + } else { + //Need to fetch the resource across domains. Assume + //the resource has been optimized into a JS module. Fetch + //by the module name + extension, but do not include the + //!strip part to avoid file system issues. + req([nonStripName], function (content) { + text.finishLoad(parsed.moduleName + '.' + parsed.ext, + parsed.strip, content, onLoad); + }); + } + }, + + write: function (pluginName, moduleName, write, config) { + if (buildMap.hasOwnProperty(moduleName)) { + var content = text.jsEscape(buildMap[moduleName]); + write.asModule(pluginName + "!" + moduleName, + "define(function () { return '" + + content + + "';});\n"); + } + }, + + writeFile: function (pluginName, moduleName, req, write, config) { + var parsed = text.parseName(moduleName), + extPart = parsed.ext ? '.' + parsed.ext : '', + nonStripName = parsed.moduleName + extPart, + //Use a '.js' file name so that it indicates it is a + //script that can be loaded across domains. + fileName = req.toUrl(parsed.moduleName + extPart) + '.js'; + + //Leverage own load() method to load plugin value, but only + //write out values that do not have the strip argument, + //to avoid any potential issues with ! in file names. + text.load(nonStripName, req, function (value) { + //Use own write() method to construct full module value. + //But need to create shell that translates writeFile's + //write() to the right interface. + var textWrite = function (contents) { + return write(fileName, contents); + }; + textWrite.asModule = function (moduleName, contents) { + return write.asModule(moduleName, fileName, contents); + }; + + text.write(pluginName, nonStripName, textWrite, config); + }, config); + } + }; + + if (masterConfig.env === 'node' || (!masterConfig.env && + typeof process !== "undefined" && + process.versions && + !!process.versions.node && + !process.versions['node-webkit'] && + !process.versions['atom-shell'])) { + //Using special require.nodeRequire, something added by r.js. + fs = require.nodeRequire('fs'); + + text.get = function (url, callback, errback) { + try { + var file = fs.readFileSync(url, 'utf8'); + //Remove BOM (Byte Mark Order) from utf8 files if it is there. + if (file[0] === '\uFEFF') { + file = file.substring(1); + } + callback(file); + } catch (e) { + if (errback) { + errback(e); + } + } + }; + } else if (masterConfig.env === 'xhr' || (!masterConfig.env && + text.createXhr())) { + text.get = function (url, callback, errback, headers) { + var xhr = text.createXhr(), header; + xhr.open('GET', url, true); + + //Allow plugins direct access to xhr headers + if (headers) { + for (header in headers) { + if (headers.hasOwnProperty(header)) { + xhr.setRequestHeader(header.toLowerCase(), headers[header]); + } + } + } + + //Allow overrides specified in config + if (masterConfig.onXhr) { + masterConfig.onXhr(xhr, url); + } + + xhr.onreadystatechange = function (evt) { + var status, err; + //Do not explicitly handle errors, those should be + //visible via console output in the browser. + if (xhr.readyState === 4) { + status = xhr.status || 0; + if (status > 399 && status < 600) { + //An http 4xx or 5xx error. Signal an error. + err = new Error(url + ' HTTP status: ' + status); + err.xhr = xhr; + if (errback) { + errback(err); + } + } else { + callback(xhr.responseText); + } + + if (masterConfig.onXhrComplete) { + masterConfig.onXhrComplete(xhr, url); + } + } + }; + xhr.send(null); + }; + } else if (masterConfig.env === 'rhino' || (!masterConfig.env && + typeof Packages !== 'undefined' && typeof java !== 'undefined')) { + //Why Java, why is this so awkward? + text.get = function (url, callback) { + var stringBuffer, line, + encoding = "utf-8", + file = new java.io.File(url), + lineSeparator = java.lang.System.getProperty("line.separator"), + input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)), + content = ''; + try { + stringBuffer = new java.lang.StringBuffer(); + line = input.readLine(); + + // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324 + // http://www.unicode.org/faq/utf_bom.html + + // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK: + // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058 + if (line && line.length() && line.charAt(0) === 0xfeff) { + // Eat the BOM, since we've already found the encoding on this file, + // and we plan to concatenating this buffer with others; the BOM should + // only appear at the top of a file. + line = line.substring(1); + } + + if (line !== null) { + stringBuffer.append(line); + } + + while ((line = input.readLine()) !== null) { + stringBuffer.append(lineSeparator); + stringBuffer.append(line); + } + //Make sure we return a JavaScript string and not a Java string. + content = String(stringBuffer.toString()); //String + } finally { + input.close(); + } + callback(content); + }; + } else if (masterConfig.env === 'xpconnect' || (!masterConfig.env && + typeof Components !== 'undefined' && Components.classes && + Components.interfaces)) { + //Avert your gaze! + Cc = Components.classes; + Ci = Components.interfaces; + Components.utils['import']('resource://gre/modules/FileUtils.jsm'); + xpcIsWindows = ('@mozilla.org/windows-registry-key;1' in Cc); + + text.get = function (url, callback) { + var inStream, convertStream, fileObj, + readData = {}; + + if (xpcIsWindows) { + url = url.replace(/\//g, '\\'); + } + + fileObj = new FileUtils.File(url); + + //XPCOM, you so crazy + try { + inStream = Cc['@mozilla.org/network/file-input-stream;1'] + .createInstance(Ci.nsIFileInputStream); + inStream.init(fileObj, 1, 0, false); + + convertStream = Cc['@mozilla.org/intl/converter-input-stream;1'] + .createInstance(Ci.nsIConverterInputStream); + convertStream.init(inStream, "utf-8", inStream.available(), + Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER); + + convertStream.readString(inStream.available(), readData); + convertStream.close(); + inStream.close(); + callback(readData.value); + } catch (e) { + throw new Error((fileObj && fileObj.path || '') + ': ' + e); + } + }; + } + return text; +}); \ No newline at end of file diff --git a/channel.js b/channel.js index 27305e9..a94689f 100755 --- a/channel.js +++ b/channel.js @@ -4,7 +4,11 @@ var requirejs = require('requirejs'); requirejs.config({ nodeRequire: require, baseUrl: 'app', - deps: ['Lib/Utilities/Channel/Extensions'] + deps: ['Lib/Utilities/Channel/Extensions'], + paths: { + text: 'Lib/Vendor/RequireJs/Plugin/Text', + json: 'Lib/Vendor/RequireJs/Plugin/Json', + }, }); var inspector = {}; diff --git a/client.js b/client.js index c94262d..b082d49 100755 --- a/client.js +++ b/client.js @@ -7,6 +7,8 @@ requirejs.config({ deps: ['Lib/Utilities/Client/Extensions'], waitSeconds: 0, paths: { + text: 'Lib/Vendor/RequireJs/Plugin/Text', + json: 'Lib/Vendor/RequireJs/Plugin/Json', screenfull: "/screenfull", chart: "/chart", socketio: "/socket.io/socket.io" diff --git a/config/build-profile.js b/config/build-profile.js index ed028e7..e650ccc 100644 --- a/config/build-profile.js +++ b/config/build-profile.js @@ -1,6 +1,8 @@ ({ baseUrl: "../app", paths: { + "text": 'Lib/Vendor/RequireJs/Plugin/Text', + "json": 'Lib/Vendor/RequireJs/Plugin/Json', "screenfull": "../node_modules/screenfull/dist/screenfull", "socketio": "../node_modules/socket.io/node_modules/socket.io-client/dist/socket.io", "chart": "../node_modules/chart.js/Chart" diff --git a/static/items/rube/ragdoll-full.json b/static/items/rube/ragdoll-full.json new file mode 100644 index 0000000..fc81cad --- /dev/null +++ b/static/items/rube/ragdoll-full.json @@ -0,0 +1,1346 @@ + +{ + "allowSleep" : true, + "autoClearForces" : true, + "body" : + [ + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.05748672783374786, + 0.05748672783374786, + -0.05748683214187622, + -0.05748683214187622 + ], + "y" : + [ + -0.2322469353675842, + 0.2322462797164917, + 0.2322462797164917, + -0.2322469353675842 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.001019014045596123, + "massData-center" : + { + "x" : -5.215406062575312e-08, + "y" : -3.278255462646484e-07 + }, + "massData-mass" : 0.05340443924069405, + "name" : "upperArmLeft", + "position" : + { + "x" : -0.1699507087469101, + "y" : 1.113796472549438 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture0", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.1718577891588211, + 0.1684816330671310, + 0.001688212156295776, + -0.1718577295541763, + -0.1718577295541763, + 0.001460619270801544 + ], + "y" : + [ + -0.3928470611572266, + 0.4921868443489075, + 0.4921868443489075, + 0.3841522336006165, + -0.4204435348510742, + -0.4519201517105103 + ] + } + } + }, + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture2", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.1679489463567734, + 0.1679489463567734, + -0.004204027354717255, + -0.004204027354717255 + ], + "y" : + [ + 0.4449140429496765, + 0.6170670390129089, + 0.6170670390129089, + 0.4449140429496765 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.03228222951292992, + "massData-center" : + { + "x" : 0.008858840912580490, + "y" : 0.06282533705234528 + }, + "massData-mass" : 0.3355117142200470, + "name" : "chest", + "position" : + { + "x" : -0.05338868126273155, + "y" : 0.9620395302772522 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "circle" : + { + "center" : + { + "x" : -0.007499951869249344, + "y" : 0.003749847412109375 + }, + "radius" : 0.2746430933475494 + }, + "density" : 0.2204959988594055, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture1" + }, + + { + "circle" : + { + "center" : + { + "x" : -0.03327952325344086, + "y" : -0.1384725570678711 + }, + "radius" : 0.2485582530498505 + }, + "density" : 0.2204959988594055, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture1" + } + ], + "linearVelocity" : 0, + "massData-I" : 0.004164268728345633, + "massData-center" : + { + "x" : -0.01910765282809734, + "y" : -0.06028826907277107 + }, + "massData-mass" : 0.09504657238721848, + "name" : "head", + "position" : + { + "x" : 0.04257059469819069, + "y" : 1.812389135360718 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.05748683214187622, + 0.05748683214187622, + -0.05748690664768219, + -0.05748690664768219 + ], + "y" : + [ + -0.1419981122016907, + 0.1419981718063354, + 0.1419981718063354, + -0.1419981122016907 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0002554289239924401, + "massData-center" : + { + "x" : -3.725290298461914e-08, + "y" : 2.980232238769531e-08 + }, + "massData-mass" : 0.03265211358666420, + "name" : "lowerArmRight", + "position" : + { + "x" : 0.1177217364311218, + "y" : 0.8479318022727966 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.1415265351533890, + 0.1415265351533890, + -0.08457186818122864, + -0.08457186818122864 + ], + "y" : + [ + -0.1143886670470238, + -0.05680520832538605, + -0.05680520832538605, + -0.1143886670470238 + ] + } + } + }, + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.08623030036687851, + 0.08623030036687851, + -0.08623020350933075, + -0.08623020350933075 + ], + "y" : + [ + -0.1138511821627617, + 0.1565139442682266, + 0.1565139442682266, + -0.1138511821627617 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0005858240183442831, + "massData-center" : + { + "x" : 0.006215983536094427, + "y" : -0.002008607611060143 + }, + "massData-mass" : 0.05964682996273041, + "name" : "lowerLegLeft", + "position" : + { + "x" : -0.08319067955017090, + "y" : 0.1298431605100632 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.05748684704303741, + 0.05748684704303741, + -0.05748672783374786, + -0.05748672783374786 + ], + "y" : + [ + -0.1419981122016907, + 0.1419981718063354, + 0.1419981718063354, + -0.1419981122016907 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0002554284874349833, + "massData-center" : + { + "x" : 5.960464477539062e-08, + "y" : 2.980232238769531e-08 + }, + "massData-mass" : 0.03265206888318062, + "name" : "lowerArmLeft", + "position" : + { + "x" : -0.1699528992176056, + "y" : 0.8479318022727966 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.05748683214187622, + 0.05748683214187622, + -0.05748690664768219, + -0.05748690664768219 + ], + "y" : + [ + -0.2322469353675842, + 0.2322462797164917, + 0.2322462797164917, + -0.2322469353675842 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.001019015791825950, + "massData-center" : + { + "x" : -3.725290298461914e-08, + "y" : -3.278255462646484e-07 + }, + "massData-mass" : 0.05340452119708061, + "name" : "upperArmRight", + "position" : + { + "x" : 0.1177217364311218, + "y" : 1.113796472549438 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.08623021841049194, + 0.08623021841049194, + -0.08623008430004120, + -0.08623008430004120 + ], + "y" : + [ + -0.2315792292356491, + 0.2315795421600342, + 0.2315795421600342, + -0.2315792292356491 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.001625877106562257, + "massData-center" : + { + "x" : 6.705522537231445e-08, + "y" : 1.564621925354004e-07 + }, + "massData-mass" : 0.07987650483846664, + "name" : "upperLegRight", + "position" : + { + "x" : 0.03142313286662102, + "y" : 0.4171121716499329 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.08623032271862030, + 0.08623032271862030, + -0.08623017370700836, + -0.08623017370700836 + ], + "y" : + [ + -0.2315792292356491, + 0.2315795421600342, + 0.2315795421600342, + -0.2315792292356491 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.001625879434868693, + "massData-center" : + { + "x" : 7.450580596923828e-08, + "y" : 1.564621925354004e-07 + }, + "massData-mass" : 0.07987659424543381, + "name" : "upperLegLeft", + "position" : + { + "x" : -0.08319067955017090, + "y" : 0.4171121716499329 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.08623021841049194, + 0.08623021841049194, + -0.08623008430004120, + -0.08623008430004120 + ], + "y" : + [ + -0.1138515025377274, + 0.1563164740800858, + 0.1563164740800858, + -0.1138515025377274 + ] + } + } + }, + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.1415264606475830, + 0.1415264606475830, + -0.08457189798355103, + -0.08457189798355103 + ], + "y" : + [ + -0.1143886670470238, + -0.05680520832538605, + -0.05680520832538605, + -0.1143886670470238 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0005849063745699823, + "massData-center" : + { + "x" : 0.006219535600394011, + "y" : -0.002099231118336320 + }, + "massData-mass" : 0.05961277708411217, + "name" : "lowerLegRight", + "position" : + { + "x" : 0.03142313286662102, + "y" : 0.1298431605100632 + }, + "type" : 2 + } + ], + "collisionbitplanes" : + { + "names" : + [ + "bitplane1", + "bitplane2", + "bitplane3", + "bitplane4", + "bitplane5", + "bitplane6", + "bitplane7", + "bitplane8", + "bitplane9", + "bitplane10", + "bitplane11", + "bitplane12", + "bitplane13", + "bitplane14", + "bitplane15", + "bitplane16", + "bitplane17", + "bitplane18", + "bitplane19", + "bitplane20", + "bitplane21", + "bitplane22", + "bitplane23", + "bitplane24", + "bitplane25", + "bitplane26", + "bitplane27", + "bitplane28", + "bitplane29", + "bitplane30", + "bitplane31", + "bitplane32" + ] + }, + "continuousPhysics" : true, + "gravity" : + { + "x" : 0, + "y" : -10 + }, + "image" : + [ + + { + "aspectScale" : 1, + "body" : 9, + "center" : + { + "x" : 0.02911517955362797, + "y" : -0.0009155124425888062 + }, + "corners" : + { + "x" : + [ + -0.08536797016859055, + 0.1435983330011368, + 0.1435983330011368, + -0.08536797016859055 + ], + "y" : + [ + -0.1153986603021622, + -0.1153986603021622, + 0.1135676354169846, + 0.1135676354169846 + ] + }, + "file" : "../../img/Characters/Chuck/lowerLeftLeg.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.08536797016859055, + -0.1153986603021622, + 0.1435983330011368, + -0.1153986603021622, + 0.1435983330011368, + 0.1135676354169846, + -0.08536797016859055, + 0.1135676354169846 + ], + "name" : "image5", + "opacity" : 1, + "scale" : 0.2289662957191467 + }, + + { + "aspectScale" : 1, + "body" : 7, + "center" : + { + "x" : -0.02732392773032188, + "y" : 0.02671334147453308 + }, + "corners" : + { + "x" : + [ + -0.1425068378448486, + 0.08785898983478546, + 0.08785898983478546, + -0.1425068378448486 + ], + "y" : + [ + -0.2324482202529907, + -0.2324482202529907, + 0.2858749032020569, + 0.2858749032020569 + ] + }, + "file" : "../../img/Characters/Chuck/upperRightLeg.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.1425068378448486, + -0.2324482202529907, + 0.08785898983478546, + -0.2324482202529907, + 0.08785898983478546, + 0.2858749032020569, + -0.1425068378448486, + 0.2858749032020569 + ], + "name" : "image6", + "opacity" : 1, + "scale" : 0.5183231234550476 + }, + + { + "aspectScale" : 1, + "body" : 6, + "center" : + { + "x" : 0.0003027096390724182, + "y" : 0.0006600618362426758 + }, + "corners" : + { + "x" : + [ + -0.05836960300803185, + 0.05897502228617668, + 0.05897502228617668, + -0.05836960300803185 + ], + "y" : + [ + -0.2340291887521744, + -0.2340291887521744, + 0.2353493124246597, + 0.2353493124246597 + ] + }, + "file" : "../../img/Characters/Chuck/upperLeftArm.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.05836960300803185, + -0.2340291887521744, + 0.05897502228617668, + -0.2340291887521744, + 0.05897502228617668, + 0.2353493124246597, + -0.05836960300803185, + 0.2353493124246597 + ], + "name" : "image4", + "opacity" : 1, + "renderOrder" : 1, + "scale" : 0.4693785011768341 + }, + + { + "aspectScale" : 1, + "body" : 3, + "center" : + { + "x" : 0.0007003694772720337, + "y" : 0.001779437065124512 + }, + "corners" : + { + "x" : + [ + -0.05596264451742172, + 0.05736338347196579, + 0.05736338347196579, + -0.05596264451742172 + ], + "y" : + [ + -0.1398780941963196, + -0.1398780941963196, + 0.1434369683265686, + 0.1434369683265686 + ] + }, + "file" : "../../img/Characters/Chuck/lowerLeftArm.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.05596264451742172, + -0.1398780941963196, + 0.05736338347196579, + -0.1398780941963196, + 0.05736338347196579, + 0.1434369683265686, + -0.05596264451742172, + 0.1434369683265686 + ], + "name" : "image3", + "opacity" : 1, + "renderOrder" : 1, + "scale" : 0.2833150625228882 + }, + + { + "aspectScale" : 1, + "body" : 1, + "center" : + { + "x" : -0.0008481591939926147, + "y" : -0.001265347003936768 + }, + "corners" : + { + "x" : + [ + -0.1698881536722183, + 0.1681918352842331, + 0.1681918352842331, + -0.1698881536722183 + ], + "y" : + [ + -0.480212002992630, + -0.480212002992630, + 0.4776813089847565, + 0.4776813089847565 + ] + }, + "file" : "../../img/Characters/Chuck/chest.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.1698881536722183, + -0.480212002992630, + 0.1681918352842331, + -0.480212002992630, + 0.1681918352842331, + 0.4776813089847565, + -0.1698881536722183, + 0.4776813089847565 + ], + "name" : "image2", + "opacity" : 1, + "renderOrder" : 5, + "scale" : 0.9578933119773865 + }, + + { + "aspectScale" : 1, + "body" : 8, + "center" : + { + "x" : 0.003173574805259705, + "y" : -0.001172244548797607 + }, + "corners" : + { + "x" : + [ + -0.1414211541414261, + 0.1477683037519455, + 0.1477683037519455, + -0.1414211541414261 + ], + "y" : + [ + -0.2325238138437271, + -0.2325238138437271, + 0.2301793247461319, + 0.2301793247461319 + ] + }, + "file" : "../../img/Characters/Chuck/upperLeftLeg.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.1414211541414261, + -0.2325238138437271, + 0.1477683037519455, + -0.2325238138437271, + 0.1477683037519455, + 0.2301793247461319, + -0.1414211541414261, + 0.2301793247461319 + ], + "name" : "image6", + "opacity" : 1, + "renderOrder" : 6, + "scale" : 0.4627031385898590 + }, + + { + "aspectScale" : 1, + "body" : 4, + "center" : + { + "x" : 0.02851789817214012, + "y" : -0.0009155124425888062 + }, + "corners" : + { + "x" : + [ + -0.08596524596214294, + 0.1430010497570038, + 0.1430010497570038, + -0.08596524596214294 + ], + "y" : + [ + -0.1153986603021622, + -0.1153986603021622, + 0.1135676354169846, + 0.1135676354169846 + ] + }, + "file" : "../../img/Characters/Chuck/lowerLeftLeg.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.08596524596214294, + -0.1153986603021622, + 0.1430010497570038, + -0.1153986603021622, + 0.1430010497570038, + 0.1135676354169846, + -0.08596524596214294, + 0.1135676354169846 + ], + "name" : "image5", + "opacity" : 1, + "renderOrder" : 6, + "scale" : 0.2289662957191467 + }, + + { + "aspectScale" : 1, + "body" : 2, + "center" : + { + "x" : 0.01975236460566521, + "y" : -0.07194232940673828 + }, + "corners" : + { + "x" : + [ + -0.2679373621940613, + 0.3074420690536499, + 0.3074420690536499, + -0.2679373621940613 + ], + "y" : + [ + -0.4171699881553650, + -0.4171699881553650, + 0.2732853293418884, + 0.2732853293418884 + ] + }, + "file" : "../../img/Characters/Chuck/head.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.2679373621940613, + -0.4171699881553650, + 0.3074420690536499, + -0.4171699881553650, + 0.3074420690536499, + 0.2732853293418884, + -0.2679373621940613, + 0.2732853293418884 + ], + "name" : "image1", + "opacity" : 1, + "renderOrder" : 6, + "scale" : 0.6904553174972534 + }, + + { + "aspectScale" : 1, + "body" : 0, + "center" : + { + "x" : 0.002138927578926086, + "y" : 0.0006600618362426758 + }, + "corners" : + { + "x" : + [ + -0.05653338506817818, + 0.06081124022603035, + 0.06081124022603035, + -0.05653338506817818 + ], + "y" : + [ + -0.2340291887521744, + -0.2340291887521744, + 0.2353493124246597, + 0.2353493124246597 + ] + }, + "file" : "../../img/Characters/Chuck/upperLeftArm.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.05653338506817818, + -0.2340291887521744, + 0.06081124022603035, + -0.2340291887521744, + 0.06081124022603035, + 0.2353493124246597, + -0.05653338506817818, + 0.2353493124246597 + ], + "name" : "image4", + "opacity" : 1, + "renderOrder" : 8, + "scale" : 0.4693785011768341 + }, + + { + "aspectScale" : 1, + "body" : 5, + "center" : + { + "x" : 0.002538725733757019, + "y" : 0.001779437065124512 + }, + "corners" : + { + "x" : + [ + -0.05412428826093674, + 0.05920173972845078, + 0.05920173972845078, + -0.05412428826093674 + ], + "y" : + [ + -0.1398780941963196, + -0.1398780941963196, + 0.1434369683265686, + 0.1434369683265686 + ] + }, + "file" : "../../img/Characters/Chuck/lowerLeftArm.png", + "filter" : 0, + "glDrawElements" : [ 0, 1, 2, 2, 3, 0 ], + "glTexCoordPointer" : [ 0.0, 0.0, 1, 0.0, 1, 1, 0.0, 1 ], + "glVertexPointer" : + [ + -0.05412428826093674, + -0.1398780941963196, + 0.05920173972845078, + -0.1398780941963196, + 0.05920173972845078, + 0.1434369683265686, + -0.05412428826093674, + 0.1434369683265686 + ], + "name" : "image3", + "opacity" : 1, + "renderOrder" : 8, + "scale" : 0.2833150625228882 + } + ], + "joint" : + [ + + { + "anchorA" : + { + "x" : 0.001047849655151367, + "y" : -0.1790249347686768 + }, + "anchorB" : + { + "x" : 0.001048207283020020, + "y" : 0.08683943748474121 + }, + "bodyA" : 0, + "bodyB" : 5, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint4", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.919862151145935 + }, + + { + "anchorA" : + { + "x" : -0.1165831685066223, + "y" : 0.3330366015434265 + }, + "anchorB" : + { + "x" : -2.135336399078369e-05, + "y" : 0.1812803745269775 + }, + "bodyA" : 1, + "bodyB" : 0, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint3", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : 0.07454992830753326, + "y" : 0.5068108439445496 + }, + "anchorB" : + { + "x" : -0.02141102217137814, + "y" : -0.3435407876968384 + }, + "bodyA" : 1, + "bodyB" : 2, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -1.221730470657349, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint0", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 0.6981316804885864 + }, + + { + "anchorA" : + { + "x" : 0.1367489844560623, + "y" : -0.3606387376785278 + }, + "anchorB" : + { + "x" : 0.05056380107998848, + "y" : 0.1842886805534363 + }, + "bodyA" : 1, + "bodyB" : 7, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.6981316804885864, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint5", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.919862151145935 + }, + + { + "anchorA" : + { + "x" : -0.08329562842845917, + "y" : -0.3541148304939270 + }, + "anchorB" : + { + "x" : -0.05503869056701660, + "y" : 0.1909851431846619 + }, + "bodyA" : 1, + "bodyB" : 8, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.6981316804885864, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint6", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.919862151145935 + }, + + { + "anchorA" : + { + "x" : 0.1710196435451508, + "y" : 0.3308989405632019 + }, + "anchorB" : + { + "x" : -9.131431579589844e-05, + "y" : 0.1791421175003052 + }, + "bodyA" : 1, + "bodyB" : 6, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint2", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : 0.0004334598779678345, + "y" : 0.08706557750701904 + }, + "anchorB" : + { + "x" : 0.0004332214593887329, + "y" : -0.1787990331649780 + }, + "bodyA" : 3, + "bodyB" : 6, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint1", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.919862151145935 + }, + + { + "anchorA" : + { + "x" : 0.002425249665975571, + "y" : -0.1845821887254715 + }, + "anchorB" : + { + "x" : 0.002425376325845718, + "y" : 0.1026860624551773 + }, + "bodyA" : 7, + "bodyB" : 9, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint8", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 0 + }, + + { + "anchorA" : + { + "x" : -0.0009558200836181641, + "y" : -0.1818936169147491 + }, + "anchorB" : + { + "x" : -0.0009555891156196594, + "y" : 0.1055182516574860 + }, + "bodyA" : 8, + "bodyB" : 4, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint7", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 0 + } + ], + "positionIterations" : 3, + "stepsPerSecond" : 60.0, + "subStepping" : false, + "velocityIterations" : 8, + "warmStarting" : true +} diff --git a/static/items/rube/ragdoll.rube b/static/items/rube/ragdoll.rube index 53f1406..b7f646a 100644 --- a/static/items/rube/ragdoll.rube +++ b/static/items/rube/ragdoll.rube @@ -71,7 +71,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 17, + "id" : 2, "name" : "fixture3", "shapes" : [ @@ -84,67 +84,35 @@ { "x" : [ - -0.08623008430004120, - 0.08623021841049194, - 0.08623021841049194, - -0.08623008430004120 + 0.07039496302604675, + 0.07039496302604675, + -0.07039486616849899, + -0.07039486616849899 ], "y" : [ - -0.1138515025377274, - -0.1138515025377274, - 0.1563164740800858, - 0.1563164740800858 - ] - } - }, - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "id" : 18, - "name" : "fixture3", - "shapes" : - [ - - { - "type" : "polygon" - } - ], - "vertices" : - { - "x" : - [ - -0.08457189798355103, - 0.1415264606475830, - 0.1415264606475830, - -0.08457189798355103 - ], - "y" : - [ - -0.1143886670470238, - -0.1143886670470238, - -0.05680520832538605, - -0.05680520832538605 + -0.09294389933347702, + 0.1276105940341949, + 0.1276105940341949, + -0.09294389933347702 ] } } ], - "id" : 13, + "id" : 1, "linearVelocity" : 0, - "massData-I" : 0.0005849063745699823, + "massData-I" : 0.0001864957448560745, "massData-center" : { - "x" : 0.006219535600394011, - "y" : -0.002099231118336320 + "x" : 4.842877032729120e-08, + "y" : 0.01733334921300411 }, - "massData-mass" : 0.05961277708411217, - "name" : "lowerLegRight", + "massData-mass" : 0.03105182945728302, + "name" : "lowerRightLeg", "position" : { - "x" : 0.03142313286662102, - "y" : 0.1298431605100632 + "x" : 0.02818956598639488, + "y" : 0.1036150008440018 }, "type" : "dynamic" }, @@ -160,7 +128,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 19, + "id" : 3, "name" : "fixture3", "shapes" : [ @@ -173,35 +141,35 @@ { "x" : [ - -0.08623017370700836, - 0.08623032271862030, - 0.08623032271862030, - -0.08623017370700836 + 0.07039505988359451, + 0.07039505988359451, + -0.07039495557546616, + -0.07039495557546616 ], "y" : [ - -0.2315792292356491, - -0.2315792292356491, - 0.2315795421600342, - 0.2315795421600342 + -0.1890522241592407, + 0.1890524625778198, + 0.1890524625778198, + -0.1890522241592407 ] } } ], - "id" : 14, + "id" : 2, "linearVelocity" : 0, - "massData-I" : 0.001625879434868693, + "massData-I" : 0.000722132739610970, "massData-center" : { - "x" : 7.450580596923828e-08, - "y" : 1.564621925354004e-07 + "x" : 5.215406417846680e-08, + "y" : 1.192092824453539e-07 }, - "massData-mass" : 0.07987659424543381, - "name" : "upperLegLeft", + "massData-mass" : 0.05323336645960808, + "name" : "upperLeftLeg", "position" : { - "x" : -0.08319067955017090, - "y" : 0.4171121716499329 + "x" : -0.06537666171789169, + "y" : 0.3381301760673523 }, "type" : "dynamic" }, @@ -217,7 +185,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 20, + "id" : 4, "name" : "fixture3", "shapes" : [ @@ -230,35 +198,35 @@ { "x" : [ - -0.08623008430004120, - 0.08623021841049194, - 0.08623021841049194, - -0.08623008430004120 + 0.07039496302604675, + 0.07039496302604675, + -0.07039486616849899, + -0.07039486616849899 ], "y" : [ - -0.2315792292356491, - -0.2315792292356491, - 0.2315795421600342, - 0.2315795421600342 + -0.1890522241592407, + 0.1890524625778198, + 0.1890524625778198, + -0.1890522241592407 ] } } ], - "id" : 15, + "id" : 3, "linearVelocity" : 0, - "massData-I" : 0.001625877106562257, + "massData-I" : 0.0007221315754577518, "massData-center" : { - "x" : 6.705522537231445e-08, - "y" : 1.564621925354004e-07 + "x" : 4.842877388000488e-08, + "y" : 1.192092895507812e-07 }, - "massData-mass" : 0.07987650483846664, - "name" : "upperLegRight", + "massData-mass" : 0.05323329567909241, + "name" : "upperRightLeg", "position" : { - "x" : 0.03142313286662102, - "y" : 0.4171121716499329 + "x" : 0.02818956598639488, + "y" : 0.3381301760673523 }, "type" : "dynamic" }, @@ -274,7 +242,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 21, + "id" : 5, "name" : "fixture3", "shapes" : [ @@ -287,35 +255,35 @@ { "x" : [ - -0.05748690664768219, - 0.05748683214187622, - 0.05748683214187622, - -0.05748690664768219 + 0.04693000018596649, + 0.04693000018596649, + -0.04693005979061127, + -0.04693005979061127 ], "y" : [ - -0.2322469353675842, - -0.2322469353675842, - 0.2322462797164917, - 0.2322462797164917 + -0.1895973682403564, + 0.1895966529846191, + 0.1895966529846191, + -0.1895973682403564 ] } } ], - "id" : 16, + "id" : 4, "linearVelocity" : 0, - "massData-I" : 0.001019015791825950, + "massData-I" : 0.0004525946278590709, "massData-center" : { - "x" : -3.725290298461914e-08, - "y" : -3.278255462646484e-07 + "x" : -2.980232238769531e-08, + "y" : -3.576278686523438e-07 }, - "massData-mass" : 0.05340452119708061, - "name" : "upperArmRight", + "massData-mass" : 0.03559117391705513, + "name" : "upperRightArm", "position" : { - "x" : 0.1177217364311218, - "y" : 1.113796472549438 + "x" : 0.09864036738872528, + "y" : 0.9068759679794312 }, "type" : "dynamic" }, @@ -331,7 +299,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 22, + "id" : 6, "name" : "fixture3", "shapes" : [ @@ -344,35 +312,35 @@ { "x" : [ - -0.05748672783374786, - 0.05748684704303741, - 0.05748684704303741, - -0.05748672783374786 + 0.04693000763654709, + 0.04693000763654709, + -0.04692991077899933, + -0.04692991077899933 ], "y" : [ - -0.1419981122016907, - -0.1419981122016907, - 0.1419981718063354, - 0.1419981718063354 + -0.1159216761589050, + 0.1159217953681946, + 0.1159217953681946, + -0.1159216761589050 ] } } ], - "id" : 17, + "id" : 5, "linearVelocity" : 0, - "massData-I" : 0.0002554284874349833, + "massData-I" : 0.0001134483172791079, "massData-center" : { - "x" : 5.960464477539062e-08, - "y" : 2.980232238769531e-08 + "x" : 4.842877032729120e-08, + "y" : 5.960464477539062e-08 }, - "massData-mass" : 0.03265206888318062, - "name" : "lowerArmLeft", + "massData-mass" : 0.02176081016659737, + "name" : "lowerLeftArm", "position" : { - "x" : -0.1699528992176056, - "y" : 0.8479318022727966 + "x" : -0.1362059414386749, + "y" : 0.6898344159126282 }, "type" : "dynamic" }, @@ -388,7 +356,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 23, + "id" : 7, "name" : "fixture3", "shapes" : [ @@ -401,67 +369,35 @@ { "x" : [ - -0.08623020350933075, - 0.08623030036687851, - 0.08623030036687851, - -0.08623020350933075 + 0.07039503753185272, + 0.07039503753185272, + -0.07039495557546616, + -0.07039495557546616 ], "y" : [ - -0.1138511821627617, - -0.1138511821627617, - 0.1565139442682266, - 0.1565139442682266 - ] - } - }, - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "id" : 24, - "name" : "fixture3", - "shapes" : - [ - - { - "type" : "polygon" - } - ], - "vertices" : - { - "x" : - [ - -0.08457186818122864, - 0.1415265351533890, - 0.1415265351533890, - -0.08457186818122864 - ], - "y" : - [ - -0.1143886670470238, - -0.1143886670470238, - -0.05680520832538605, - -0.05680520832538605 + -0.09294363856315613, + 0.1277718394994736, + 0.1277718394994736, + -0.09294363856315613 ] } } ], - "id" : 18, + "id" : 6, "linearVelocity" : 0, - "massData-I" : 0.0005858240183442831, + "massData-I" : 0.0001869033440016210, "massData-center" : { - "x" : 0.006215983536094427, - "y" : -0.002008607611060143 + "x" : 4.097818973036738e-08, + "y" : 0.01741409860551357 }, - "massData-mass" : 0.05964682996273041, - "name" : "lowerLegLeft", + "massData-mass" : 0.03107452951371670, + "name" : "lowerLeftLeg", "position" : { - "x" : -0.08319067955017090, - "y" : 0.1298431605100632 + "x" : -0.06537666171789169, + "y" : 0.1036150008440018 }, "type" : "dynamic" }, @@ -477,7 +413,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 25, + "id" : 9, "name" : "fixture3", "shapes" : [ @@ -490,35 +426,35 @@ { "x" : [ - -0.05748690664768219, - 0.05748683214187622, - 0.05748683214187622, - -0.05748690664768219 + 0.04693000018596649, + 0.04693000018596649, + -0.04693005979061127, + -0.04693005979061127 ], "y" : [ - -0.1419981122016907, - -0.1419981122016907, - 0.1419981718063354, - 0.1419981718063354 + -0.1159216761589050, + 0.1159217953681946, + 0.1159217953681946, + -0.1159216761589050 ] } } ], - "id" : 19, + "id" : 7, "linearVelocity" : 0, - "massData-I" : 0.0002554289239924401, + "massData-I" : 0.0001134485355578363, "massData-center" : { - "x" : -3.725290298461914e-08, - "y" : 2.980232238769531e-08 + "x" : -2.980232238769531e-08, + "y" : 5.960464477539062e-08 }, - "massData-mass" : 0.03265211358666420, - "name" : "lowerArmRight", + "massData-mass" : 0.02176084183156490, + "name" : "lowerRightArm", "position" : { - "x" : 0.1177217364311218, - "y" : 0.8479318022727966 + "x" : 0.09864036738872528, + "y" : 0.6898344159126282 }, "type" : "dynamic" }, @@ -534,58 +470,37 @@ "density" : 0.2204959988594055, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 26, + "id" : 10, "name" : "fixture1", "shapes" : [ { - "radius" : 0.2746430933475494, + "radius" : 0.2268356680870056, "type" : "circle" } ], "vertices" : { - "x" : [ -0.007499951869249344 ], - "y" : [ 0.003749847412109375 ] - } - }, - - { - "density" : 0.2204959988594055, - "filter-groupIndex" : -55, - "friction" : 0.2, - "id" : 27, - "name" : "fixture1", - "shapes" : - [ - - { - "radius" : 0.2485582530498505, - "type" : "circle" - } - ], - "vertices" : - { - "x" : [ -0.03327952325344086 ], - "y" : [ -0.1384725570678711 ] + "x" : [ -0.002679032273590565 ], + "y" : [ 0.004700660705566406 ] } } ], - "id" : 20, + "id" : 8, "linearVelocity" : 0, - "massData-I" : 0.004164268728345633, + "massData-I" : 0.0009180362685583532, "massData-center" : { - "x" : -0.01910765282809734, - "y" : -0.06028826907277107 + "x" : -0.002679032273590565, + "y" : 0.004700660705566406 }, - "massData-mass" : 0.09504657238721848, + "massData-mass" : 0.03564291819930077, "name" : "head", "position" : { - "x" : 0.04257059469819069, - "y" : 1.812389135360718 + "x" : 0.009572610259056091, + "y" : 1.462979435920715 }, "type" : "dynamic" }, @@ -601,7 +516,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 28, + "id" : 13, "name" : "fixture0", "shapes" : [ @@ -614,71 +529,39 @@ { "x" : [ - -0.1718577295541763, - 0.001460619270801544, - 0.1718577891588211, - 0.1684816330671310, - 0.001688212156295776, - -0.1718577295541763 + 0.1402979493141174, + 0.1375417709350586, + 0.001378186047077179, + -0.1402979493141174, + -0.1402979493141174, + 0.001192390918731689 ], "y" : [ - -0.4204435348510742, - -0.4519201517105103, - -0.3928470611572266, - 0.4921868443489075, - 0.4921868443489075, - 0.3841522336006165 - ] - } - }, - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "id" : 29, - "name" : "fixture2", - "shapes" : - [ - - { - "type" : "polygon" - } - ], - "vertices" : - { - "x" : - [ - -0.004204027354717255, - 0.1679489463567734, - 0.1679489463567734, - -0.004204027354717255 - ], - "y" : - [ - 0.4449140429496765, - 0.4449140429496765, - 0.6170670390129089, - 0.6170670390129089 + -0.3207050263881683, + 0.4018019437789917, + 0.4018019437789917, + 0.3136067390441895, + -0.3432337343692780, + -0.3689299821853638 ] } } ], - "id" : 21, + "id" : 9, "linearVelocity" : 0, - "massData-I" : 0.03228222951292992, + "massData-I" : 0.01047351956367493, "massData-center" : { - "x" : 0.008858840912580490, - "y" : 0.06282533705234528 + "x" : 0.001456731930375099, + "y" : 0.01425695233047009 }, - "massData-mass" : 0.3355117142200470, + "massData-mass" : 0.2038488984107971, "name" : "chest", "position" : { - "x" : -0.05338868126273155, - "y" : 0.9620395302772522 + "x" : -0.04104747623205185, + "y" : 0.7829875946044922 }, "type" : "dynamic" }, @@ -694,7 +577,7 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 30, + "id" : 14, "name" : "fixture3", "shapes" : [ @@ -707,318 +590,137 @@ { "x" : [ - -0.05748683214187622, - 0.05748672783374786, - 0.05748672783374786, - -0.05748683214187622 + 0.04692991077899933, + 0.04692991077899933, + -0.04692997038364410, + -0.04692997038364410 ], "y" : [ - -0.2322469353675842, - -0.2322469353675842, - 0.2322462797164917, - 0.2322462797164917 + -0.1895973682403564, + 0.1895966529846191, + 0.1895966529846191, + -0.1895973682403564 ] } } ], - "id" : 22, + "id" : 10, "linearVelocity" : 0, - "massData-I" : 0.001019014045596123, + "massData-I" : 0.0004525936674326658, "massData-center" : { - "x" : -5.215406062575312e-08, - "y" : -3.278255462646484e-07 + "x" : -2.980232238769531e-08, + "y" : -3.576278686523438e-07 }, - "massData-mass" : 0.05340443924069405, - "name" : "upperArmLeft", + "massData-mass" : 0.03559110686182976, + "name" : "upperLeftArm", "position" : { - "x" : -0.1699507087469101, - "y" : 1.113796472549438 + "x" : -0.1362041532993317, + "y" : 0.9068759679794312 }, "type" : "dynamic" } ], - "metaimage" : - [ - - { - "aspectScale" : 1, - "body" : 21, - "center" : - { - "x" : -0.0008481591939926147, - "y" : -0.001265347003936768 - }, - "file" : "../../img/Characters/Chuck/chest.png", - "filter" : 0, - "flip" : false, - "id" : 15, - "name" : "image2", - "opacity" : 1, - "renderOrder" : 5, - "scale" : 0.9578933119773865 - }, - - { - "aspectScale" : 1, - "body" : 18, - "center" : - { - "x" : 0.02851789817214012, - "y" : -0.0009155124425888062 - }, - "file" : "../../img/Characters/Chuck/lowerLeftLeg.png", - "filter" : 0, - "flip" : false, - "id" : 16, - "name" : "image5", - "opacity" : 1, - "renderOrder" : 6, - "scale" : 0.2289662957191467 - }, - - { - "aspectScale" : 1, - "body" : 20, - "center" : - { - "x" : 0.01975236460566521, - "y" : -0.07194232940673828 - }, - "file" : "../../img/Characters/Chuck/head.png", - "filter" : 0, - "flip" : false, - "id" : 17, - "name" : "image1", - "opacity" : 1, - "renderOrder" : 6, - "scale" : 0.6904553174972534 - }, - - { - "aspectScale" : 1, - "body" : 22, - "center" : - { - "x" : 0.002138927578926086, - "y" : 0.0006600618362426758 - }, - "file" : "../../img/Characters/Chuck/upperLeftArm.png", - "filter" : 0, - "flip" : false, - "id" : 18, - "name" : "image4", - "opacity" : 1, - "renderOrder" : 8, - "scale" : 0.4693785011768341 - }, - - { - "aspectScale" : 1, - "body" : 16, - "center" : - { - "x" : 0.0003027096390724182, - "y" : 0.0006600618362426758 - }, - "file" : "../../img/Characters/Chuck/upperLeftArm.png", - "filter" : 0, - "flip" : false, - "id" : 19, - "name" : "image4", - "opacity" : 1, - "renderOrder" : 1, - "scale" : 0.4693785011768341 - }, - - { - "aspectScale" : 1, - "body" : 17, - "center" : - { - "x" : 0.002538725733757019, - "y" : 0.001779437065124512 - }, - "file" : "../../img/Characters/Chuck/lowerLeftArm.png", - "filter" : 0, - "flip" : false, - "id" : 20, - "name" : "image3", - "opacity" : 1, - "renderOrder" : 8, - "scale" : 0.2833150625228882 - }, - - { - "aspectScale" : 1, - "body" : 19, - "center" : - { - "x" : 0.0007003694772720337, - "y" : 0.001779437065124512 - }, - "file" : "../../img/Characters/Chuck/lowerLeftArm.png", - "filter" : 0, - "flip" : false, - "id" : 21, - "name" : "image3", - "opacity" : 1, - "renderOrder" : 1, - "scale" : 0.2833150625228882 - }, - - { - "aspectScale" : 1, - "body" : 14, - "center" : - { - "x" : 0.003173574805259705, - "y" : -0.001172244548797607 - }, - "file" : "../../img/Characters/Chuck/upperLeftLeg.png", - "filter" : 0, - "flip" : false, - "id" : 22, - "name" : "image6", - "opacity" : 1, - "renderOrder" : 6, - "scale" : 0.4627031385898590 - }, - - { - "aspectScale" : 1, - "body" : 15, - "center" : - { - "x" : -0.02732392773032188, - "y" : 0.02671334147453308 - }, - "file" : "../../img/Characters/Chuck/upperRightLeg.png", - "filter" : 0, - "flip" : false, - "id" : 23, - "name" : "image6", - "opacity" : 1, - "scale" : 0.5183231234550476 - }, - - { - "aspectScale" : 1, - "body" : 13, - "center" : - { - "x" : 0.02911517955362797, - "y" : -0.0009155124425888062 - }, - "file" : "../../img/Characters/Chuck/lowerLeftLeg.png", - "filter" : 0, - "flip" : false, - "id" : 24, - "name" : "image5", - "opacity" : 1, - "scale" : 0.2289662957191467 - } - ], "metajoint" : [ { "anchorA" : { - "x" : 0.07454992830753326, - "y" : 0.5068107843399048 + "x" : -0.0007802955806255341, + "y" : -0.1484908312559128 }, "anchorB" : { - "x" : -0.02141102217137814, - "y" : -0.3435407876968384 + "x" : -0.0007801018655300140, + "y" : 0.08614096790552139 }, - "bodyA" : 21, - "bodyB" : 20, + "bodyA" : 2, + "bodyB" : 6, "collideConnected" : false, "enableLimit" : true, "enableMotor" : false, - "id" : 10, - "lowerLimit" : -1.221730470657349, + "id" : 1, + "lowerLimit" : 0.01745329238474369, "maxMotorTorque" : 1, "motorSpeed" : 0, - "name" : "joint0", + "name" : "joint7", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 0.6981316804885864 + "upperLimit" : 2.268928050994873 }, { "anchorA" : { - "x" : 0.002425247803330421, - "y" : -0.1845821887254715 + "x" : 0.001979876309633255, + "y" : -0.1506856828927994 }, "anchorB" : { - "x" : 0.002425374463200569, - "y" : 0.1026860624551773 + "x" : 0.001979988068342209, + "y" : 0.08382887393236160 }, - "bodyA" : 15, - "bodyB" : 13, + "bodyA" : 3, + "bodyB" : 1, "collideConnected" : false, "enableLimit" : true, "enableMotor" : false, - "id" : 11, - "lowerLimit" : -2.268928050994873, + "id" : 2, + "lowerLimit" : 0.01745329238474369, "maxMotorTorque" : 1, "motorSpeed" : 0, "name" : "joint8", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 0 + "upperLimit" : 2.268928050994873 }, { "anchorA" : { - "x" : -0.1165831685066223, - "y" : 0.3330365419387817 + "x" : 0.0003538504242897034, + "y" : 0.07107692956924438 }, "anchorB" : { - "x" : -2.135336399078369e-05, - "y" : 0.1812803745269775 + "x" : 0.0003536641597747803, + "y" : -0.1459646224975586 }, - "bodyA" : 21, - "bodyB" : 22, + "bodyA" : 7, + "bodyB" : 4, "collideConnected" : false, - "enableLimit" : false, + "enableLimit" : true, "enableMotor" : false, - "id" : 12, - "lowerLimit" : -2.268928050994873, + "id" : 3, + "lowerLimit" : -1.919862151145935, "maxMotorTorque" : 1, "motorSpeed" : 0, - "name" : "joint3", + "name" : "joint1", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 3.141592741012573 + "upperLimit" : 0.01745329238474369 }, { "anchorA" : { - "x" : 0.1710196435451508, - "y" : 0.3308988809585571 + "x" : 0.1396137326955795, + "y" : 0.2701327204704285 }, "anchorB" : { - "x" : -9.131431579589844e-05, - "y" : 0.1791421175003052 + "x" : -7.455050945281982e-05, + "y" : 0.1462445855140686 }, - "bodyA" : 21, - "bodyB" : 16, + "bodyA" : 9, + "bodyB" : 4, "collideConnected" : false, "enableLimit" : false, "enableMotor" : false, - "id" : 13, + "id" : 4, "lowerLimit" : -2.268928050994873, "maxMotorTorque" : 1, "motorSpeed" : 0, @@ -1031,24 +733,24 @@ { "anchorA" : { - "x" : 0.0004334598779678345, - "y" : 0.08706557750701904 + "x" : -0.06799929589033127, + "y" : -0.2890855073928833 }, "anchorB" : { - "x" : 0.0004332214593887329, - "y" : -0.1787990331649780 + "x" : -0.04493143782019615, + "y" : 0.1559127867221832 }, - "bodyA" : 19, - "bodyB" : 16, + "bodyA" : 9, + "bodyB" : 2, "collideConnected" : false, "enableLimit" : true, "enableMotor" : false, - "id" : 14, - "lowerLimit" : 0, + "id" : 5, + "lowerLimit" : -0.6981316804885864, "maxMotorTorque" : 1, "motorSpeed" : 0, - "name" : "joint1", + "name" : "joint6", "referenceAngle" : 0, "type" : "revolute", "upperLimit" : 1.919862151145935 @@ -1057,20 +759,20 @@ { "anchorA" : { - "x" : 0.1367489844560623, - "y" : -0.3606387376785278 + "x" : 0.1116365119814873, + "y" : -0.2944114208221436 }, "anchorB" : { - "x" : 0.05056379735469818, - "y" : 0.1842886805534363 + "x" : 0.04127831012010574, + "y" : 0.1504460573196411 }, - "bodyA" : 21, - "bodyB" : 15, + "bodyA" : 9, + "bodyB" : 3, "collideConnected" : false, "enableLimit" : true, "enableMotor" : false, - "id" : 15, + "id" : 6, "lowerLimit" : -0.6981316804885864, "maxMotorTorque" : 1, "motorSpeed" : 0, @@ -1083,79 +785,79 @@ { "anchorA" : { - "x" : 0.001047849655151367, - "y" : -0.1790249347686768 + "x" : -0.09517394006252289, + "y" : 0.2718779444694519 }, "anchorB" : { - "x" : 0.001048207283020020, - "y" : 0.08683943748474121 + "x" : -1.741945743560791e-05, + "y" : 0.1479902863502502 }, - "bodyA" : 22, - "bodyB" : 17, + "bodyA" : 9, + "bodyB" : 10, + "collideConnected" : false, + "enableLimit" : false, + "enableMotor" : false, + "id" : 8, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint3", + "referenceAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : 0.0008554458618164062, + "y" : -0.1461489200592041 + }, + "anchorB" : + { + "x" : 0.0008557140827178955, + "y" : 0.07089227437973022 + }, + "bodyA" : 10, + "bodyB" : 5, "collideConnected" : false, "enableLimit" : true, "enableMotor" : false, - "id" : 16, - "lowerLimit" : 0, + "id" : 9, + "lowerLimit" : -1.919862151145935, "maxMotorTorque" : 1, "motorSpeed" : 0, "name" : "joint4", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 1.919862151145935 + "upperLimit" : 0.01745329238474369 }, { "anchorA" : { - "x" : -0.0009558200836181641, - "y" : -0.1818936169147491 + "x" : 0.06392270326614380, + "y" : 0.4330990016460419 }, "anchorB" : { - "x" : -0.0009555891156196594, - "y" : 0.1055182516574860 + "x" : 0.01330260001122952, + "y" : -0.2468920052051544 }, - "bodyA" : 14, - "bodyB" : 18, + "bodyA" : 9, + "bodyB" : 8, "collideConnected" : false, "enableLimit" : true, "enableMotor" : false, - "id" : 17, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint7", - "referenceAngle" : 0, - "type" : "revolute", - "upperLimit" : 0 - }, - - { - "anchorA" : - { - "x" : -0.08329562842845917, - "y" : -0.3541148304939270 - }, - "anchorB" : - { - "x" : -0.0550386831164360, - "y" : 0.1909851431846619 - }, - "bodyA" : 21, - "bodyB" : 14, - "collideConnected" : false, - "enableLimit" : true, - "enableMotor" : false, - "id" : 18, + "id" : 29, "lowerLimit" : -0.6981316804885864, - "maxMotorTorque" : 1, + "maxMotorTorque" : 0, "motorSpeed" : 0, - "name" : "joint6", + "name" : "joint9", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 1.919862151145935 + "upperLimit" : 1.221730470657349 } ], "positionIterations" : 3, diff --git a/static/maps/tiled/debug.json b/static/maps/tiled/debug.json index 8c48f07..b26ed3f 100644 --- a/static/maps/tiled/debug.json +++ b/static/maps/tiled/debug.json @@ -108,8 +108,8 @@ "type":"", "visible":true, "width":0, - "x":516.282764098491, - "y":128.219675479405 + "x":548.282764098491, + "y":130.219675479405 }, { "ellipse":true, @@ -215,17 +215,17 @@ { "height":0, "id":10, - "name":"Rube", + "name":"RubeDoll", "properties": { }, "rotation":0, - "type":"rube", + "type":"", "visible":true, "width":0, - "x":236.607333333333, - "y":462.255333333333 + "x":504.607333333333, + "y":111.255333333333 }, { "height":0, From cd956b8a280e1fb52d7a84eaf2f611ddff98cd73 Mon Sep 17 00:00:00 2001 From: logsol Date: Tue, 28 Apr 2015 14:56:29 +0200 Subject: [PATCH 22/68] fixed a few bugs - rube loader was manipulating the json, which resulted in coordinates flipping every second time --- app/Lib/Vendor/RubeLoader.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Lib/Vendor/RubeLoader.js b/app/Lib/Vendor/RubeLoader.js index 49674c3..2b6d5a1 100644 --- a/app/Lib/Vendor/RubeLoader.js +++ b/app/Lib/Vendor/RubeLoader.js @@ -152,8 +152,7 @@ function (Box2D) { if ( bodyJson.hasOwnProperty('linearVelocity') && bodyJson.linearVelocity instanceof Object ) bd.linearVelocity.SetV( bodyJson.linearVelocity ); if ( bodyJson.hasOwnProperty('position') && bodyJson.position instanceof Object ) - bodyJson.position.y *= -1; - bd.position.SetV( bodyJson.position ); + bd.position.SetV( this.getVectorValue(bodyJson.position) ); if ( bodyJson.hasOwnProperty('awake') ) bd.awake = bodyJson.awake; else @@ -169,6 +168,7 @@ function (Box2D) { body.name = bodyJson.name; if ( bodyJson.hasOwnProperty('customProperties') ) body.customProperties = bodyJson.customProperties; + return body; } @@ -231,8 +231,7 @@ function (Box2D) { RubeLoader.prototype.getVectorValue = function (val) { if ( val instanceof Object ) { - val.y *= -1; - return val; + return { x: val.x, y: val.y * -1 }; } else { return { x:0, y:0 }; } From 2dea240a4b69f40ca9182933fbd4a356cd33bab8 Mon Sep 17 00:00:00 2001 From: logsol Date: Tue, 28 Apr 2015 14:57:22 +0200 Subject: [PATCH 23/68] implemented rube doll to appear when dying --- .../Channel/GameObjects/Items/RubeDoll.js | 42 +++++++++++++++++-- app/Game/Client/GameObjects/Items/RubeDoll.js | 8 +++- app/Game/Client/Player.js | 4 -- app/Game/Core/GameObjects/Items/RubeDoll.js | 41 +++++++++++++++++- app/Game/Core/Player.js | 18 ++++++-- 5 files changed, 99 insertions(+), 14 deletions(-) diff --git a/app/Game/Channel/GameObjects/Items/RubeDoll.js b/app/Game/Channel/GameObjects/Items/RubeDoll.js index 3e27b2b..b810471 100644 --- a/app/Game/Channel/GameObjects/Items/RubeDoll.js +++ b/app/Game/Channel/GameObjects/Items/RubeDoll.js @@ -1,11 +1,45 @@ define([ - "Game/Core/GameObjects/Items/RubeDoll" + "Game/Core/GameObjects/Items/RubeDoll", + "Game/Config/Settings", + "Lib/Utilities/NotificationCenter" ], -function (Parent) { +function (Parent, Settings, Nc) { - "use strict"; + "use strict"; + + function RubeDoll(physicsEngine, uid, options) { + Parent.call(this, physicsEngine, uid, options); + } - return Parent; + RubeDoll.prototype = Object.create(Parent.prototype); + + RubeDoll.prototype.beingReleased = function(player) { + Parent.prototype.beingReleased.call(this, player); + if(this.scheduledForDestruction) { + this.delayedDestroy(); + } + }; + + RubeDoll.prototype.delayedDestroy = function() { + var self = this; + this.scheduledForDestruction = true; + this.destructionTimeout = setTimeout(function() { + Nc.trigger(Nc.ns.channel.to.client.gameCommand.broadcast, 'removeGameObject', { + type: 'animated', + uid: self.uid + }); + self.destroy(); + }, Settings.RAGDOLL_DESTRUCTION_TIME * 1000); + }; + + RubeDoll.prototype.destroy = function() { + if(this.scheduledForDestruction) { + clearTimeout(this.destructionTimeout); + } + Parent.prototype.destroy.call(this); + }; + + return RubeDoll; }); \ No newline at end of file diff --git a/app/Game/Client/GameObjects/Items/RubeDoll.js b/app/Game/Client/GameObjects/Items/RubeDoll.js index 2c76d91..078fd9a 100644 --- a/app/Game/Client/GameObjects/Items/RubeDoll.js +++ b/app/Game/Client/GameObjects/Items/RubeDoll.js @@ -11,7 +11,7 @@ function (Parent, Layer, Settings, Nc) { function RubeDoll(physicsEngine, uid, options) { - this.primaryColor = 0x008800; + this.primaryColor = options.primaryColor; var limbOptions = {}; @@ -160,6 +160,12 @@ function (Parent, Layer, Settings, Nc) { }; RubeDoll.prototype.destroy = function() { + + for (var name in this.limbMeshes) { + Nc.trigger(Nc.ns.client.view.mesh.remove, this.layerId, this.limbMeshes[name]); + }; + + Parent.prototype.destroy.call(this); }; RubeDoll.prototype.render = function() { diff --git a/app/Game/Client/Player.js b/app/Game/Client/Player.js index 5170f63..cb7c9db 100755 --- a/app/Game/Client/Player.js +++ b/app/Game/Client/Player.js @@ -83,10 +83,6 @@ function (Parent, Nc, Settings) { } }; - Player.prototype.getNickname = function() { - return this.user.options.nickname; - }; - Player.prototype.render = function() { if(this.doll) { diff --git a/app/Game/Core/GameObjects/Items/RubeDoll.js b/app/Game/Core/GameObjects/Items/RubeDoll.js index ad3323e..ea5b6c0 100644 --- a/app/Game/Core/GameObjects/Items/RubeDoll.js +++ b/app/Game/Core/GameObjects/Items/RubeDoll.js @@ -4,10 +4,11 @@ define([ "Lib/Vendor/Box2D", "Game/Config/Settings", "Lib/Utilities/Assert", + "Lib/Utilities/NotificationCenter", "json!Game/Asset/RubeDoll.json" // using requirejs json loader plugin ], -function (Parent, RubeLoader, Box2D, Settings, Assert, RubeDollJson) { +function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { "use strict"; @@ -45,6 +46,13 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, RubeDollJson) { RubeDoll.prototype = Object.create(Parent.prototype); + RubeDoll.prototype.getFixtureDef = function() { + + var fixtureDef = new Box2D.Dynamics.b2FixtureDef(); + fixtureDef.shape = new Box2D.Collision.Shapes.b2CircleShape(); + return fixtureDef; + }; + RubeDoll.prototype.flip = function(direction) { Parent.prototype.flip.call(this, direction); // Extend @@ -61,6 +69,37 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, RubeDollJson) { this.body.SetPosition(position); }; + + RubeDoll.prototype.setVelocities = function(options) { + Assert.number(options.linearVelocity.x, options.linearVelocity.y); + Assert.number(options.angularVelocity); + + this.body.SetLinearVelocity(options.linearVelocity); + this.body.SetAngularVelocity(options.angularVelocity); + for(var name in this.limbs) { + this.limbs[name].SetLinearVelocity(options.linearVelocity); + } + }; + + RubeDoll.prototype.getPosition = function() { + return this.body.GetPosition().Copy(); + }; + + RubeDoll.prototype.getHeadPosition = function() { + return this.limbs.head.GetPosition().Copy(); + }; + + RubeDoll.prototype.destroy = function() { + + Nc.trigger(Nc.ns.core.game.gameObject.remove, "animated", this); + var world = this.body.GetWorld(); + + for (var name in this.limbs) { + world.DestroyBody(this.limbs[name]); + } + + Parent.prototype.destroy.call(this); + }; return RubeDoll; }); \ No newline at end of file diff --git a/app/Game/Core/Player.js b/app/Game/Core/Player.js index e9a818a..67b492b 100755 --- a/app/Game/Core/Player.js +++ b/app/Game/Core/Player.js @@ -3,11 +3,12 @@ define([ "Game/Config/Settings", "Lib/Utilities/NotificationCenter", "Lib/Utilities/Exception", + "Lib/Utilities/ColorConverter", "Game/" + GLOBALS.context + "/GameObjects/SpectatorDoll", - "Game/" + GLOBALS.context + "/GameObjects/Items/RagDoll" + "Game/" + GLOBALS.context + "/GameObjects/Items/RubeDoll" ], -function (Doll, Settings, Nc, Exception, SpectatorDoll, RagDoll) { +function (Doll, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll) { "use strict"; @@ -30,6 +31,10 @@ function (Doll, Settings, Nc, Exception, SpectatorDoll, RagDoll) { Nc.trigger(Nc.ns.core.game.gameObject.add, 'animated', this); } + Player.prototype.getNickname = function() { + return this.user.options.nickname; + }; + Player.prototype.getActiveDoll = function() { if(this.spawned) { return this.doll; @@ -112,6 +117,10 @@ function (Doll, Settings, Nc, Exception, SpectatorDoll, RagDoll) { } // prepare for creating the ragdoll + + var converter = new ColorConverter(); + var primaryColor = converter.getColorByName(this.getNickname()); + var options = { x: this.getPosition().x * Settings.RATIO, y: this.getPosition().y * Settings.RATIO, @@ -123,10 +132,11 @@ function (Doll, Settings, Nc, Exception, SpectatorDoll, RagDoll) { type: "ragdoll", weight: 3, width: 5, - height: 12 + height: 12, + primaryColor: primaryColor }; - var ragDoll = new RagDoll(this.physicsEngine, "ragDoll-" + this.id + "-" + ragDollId, options); + var ragDoll = new RubeDoll(this.physicsEngine, "ragDoll-" + this.id + "-" + ragDollId, options); ragDoll.setVelocities(this.doll.getVelocities()); this.spawned = false; From da7e0758bb6106e95d4aecde0a14d29ca04a99c7 Mon Sep 17 00:00:00 2001 From: logsol Date: Tue, 28 Apr 2015 15:50:45 +0200 Subject: [PATCH 24/68] changed box2d calculation config #158 --- app/Game/Config/Settings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Game/Config/Settings.js b/app/Game/Config/Settings.js index 993e3e4..4e93113 100755 --- a/app/Game/Config/Settings.js +++ b/app/Game/Config/Settings.js @@ -16,8 +16,8 @@ function () { BOX2D_WORLD_AABB_SIZE: 3000, BOX2D_ALLOW_SLEEP: true, BOX2D_GRAVITY: 26, - BOX2D_VELOCITY_ITERATIONS: 5, - BOX2D_POSITION_ITERATIONS: 5, + BOX2D_VELOCITY_ITERATIONS: 10, + BOX2D_POSITION_ITERATIONS: 6, BOX2D_TIME_STEP: 1 / 60, // PATHS From fb3ac40d17b9a68f56e6b613eec5951d6e74568b Mon Sep 17 00:00:00 2001 From: logsol Date: Wed, 29 Apr 2015 00:04:17 +0200 Subject: [PATCH 25/68] implemented rubedoll direction flip and added meshIndex (z) swapping capability. #151 --- app/Game/Asset/RubeDoll.json | 666 +++++++++--------- app/Game/Channel/GameController.js | 6 +- .../Channel/GameObjects/Items/RubeDoll.js | 10 + app/Game/Client/GameObjects/Items/RubeDoll.js | 46 +- app/Game/Client/View/LayerManager.js | 8 +- app/Game/Client/View/Pixi/Layer.js | 8 + app/Game/Core/GameObjects/Doll.js | 2 +- app/Game/Core/GameObjects/Items/RubeDoll.js | 58 +- app/Game/Core/Player.js | 11 +- app/Lib/Utilities/NotificationCenter.js | 3 +- app/Lib/Vendor/RubeLoader.js | 2 +- static/items/rube/ragdoll.rube | 52 +- 12 files changed, 483 insertions(+), 389 deletions(-) diff --git a/app/Game/Asset/RubeDoll.json b/app/Game/Asset/RubeDoll.json index 114e29f..37e4c0e 100644 --- a/app/Game/Asset/RubeDoll.json +++ b/app/Game/Asset/RubeDoll.json @@ -5,6 +5,57 @@ "body" : [ + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture2", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.1570904254913330, + 0.1570904254913330, + -0.1156365871429443, + -0.1156365871429443 + ], + "y" : + [ + -0.3584164977073669, + 0.4034895300865173, + 0.4034895300865173, + -0.3584164977073669 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.01153474207967520, + "massData-center" : + { + "x" : 0.02072691917419434, + "y" : 0.02253651618957520 + }, + "massData-mass" : 0.2077923566102982, + "name" : "chest", + "position" : + { + "x" : -0.04104747623205185, + "y" : 0.7829875946044922 + }, + "type" : 2 + }, + { "angle" : 0, "angularVelocity" : 0, @@ -67,86 +118,42 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "name" : "fixture0", + "name" : "fixture3", "polygon" : { "vertices" : { "x" : [ - 0.1402979493141174, - 0.1375417709350586, - 0.001378186047077179, - -0.1402979493141174, - -0.1402979493141174, - 0.001192390918731689 + 0.07039496302604675, + 0.07039496302604675, + -0.07039486616849899, + -0.07039486616849899 ], "y" : [ - -0.3207050263881683, - 0.4018019437789917, - 0.4018019437789917, - 0.3136067390441895, - -0.3432337343692780, - -0.3689299821853638 + -0.09294389933347702, + 0.1276105940341949, + 0.1276105940341949, + -0.09294389933347702 ] } } } ], "linearVelocity" : 0, - "massData-I" : 0.01047351956367493, + "massData-I" : 0.0001864957448560745, "massData-center" : { - "x" : 0.001456731930375099, - "y" : 0.01425695233047009 + "x" : 4.842877032729120e-08, + "y" : 0.01733334921300411 }, - "massData-mass" : 0.2038488984107971, - "name" : "chest", + "massData-mass" : 0.03105182945728302, + "name" : "lowerRightLeg", "position" : { - "x" : -0.04104747623205185, - "y" : 0.7829875946044922 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "circle" : - { - "center" : - { - "x" : -0.002679032273590565, - "y" : 0.004700660705566406 - }, - "radius" : 0.2268356680870056 - }, - "density" : 0.2204959988594055, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture1" - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0009180362685583532, - "massData-center" : - { - "x" : -0.002679032273590565, - "y" : 0.004700660705566406 - }, - "massData-mass" : 0.03564291819930077, - "name" : "head", - "position" : - { - "x" : 0.009572610259056091, - "y" : 1.462979435920715 + "x" : 0.02818956598639488, + "y" : 0.1036150008440018 }, "type" : 2 }, @@ -169,35 +176,35 @@ { "x" : [ - 0.04693000018596649, - 0.04693000018596649, - -0.04693005979061127, - -0.04693005979061127 + 0.07039505988359451, + 0.07039505988359451, + -0.07039495557546616, + -0.07039495557546616 ], "y" : [ - -0.1159216761589050, - 0.1159217953681946, - 0.1159217953681946, - -0.1159216761589050 + -0.1890522241592407, + 0.1890524625778198, + 0.1890524625778198, + -0.1890522241592407 ] } } } ], "linearVelocity" : 0, - "massData-I" : 0.0001134485355578363, + "massData-I" : 0.000722132739610970, "massData-center" : { - "x" : -2.980232238769531e-08, - "y" : 5.960464477539062e-08 + "x" : 5.215406417846680e-08, + "y" : 1.192092824453539e-07 }, - "massData-mass" : 0.02176084183156490, - "name" : "lowerRightArm", + "massData-mass" : 0.05323336645960808, + "name" : "upperLeftLeg", "position" : { - "x" : 0.09864036738872528, - "y" : 0.6898344159126282 + "x" : -0.06537666171789169, + "y" : 0.3381301760673523 }, "type" : 2 }, @@ -304,57 +311,6 @@ "type" : 2 }, - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.04693000018596649, - 0.04693000018596649, - -0.04693005979061127, - -0.04693005979061127 - ], - "y" : - [ - -0.1895973682403564, - 0.1895966529846191, - 0.1895966529846191, - -0.1895973682403564 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0004525946278590709, - "massData-center" : - { - "x" : -2.980232238769531e-08, - "y" : -3.576278686523438e-07 - }, - "massData-mass" : 0.03559117391705513, - "name" : "upperRightArm", - "position" : - { - "x" : 0.09864036738872528, - "y" : 0.9068759679794312 - }, - "type" : 2 - }, - { "angle" : 0, "angularVelocity" : 0, @@ -424,35 +380,35 @@ { "x" : [ - 0.07039505988359451, - 0.07039505988359451, - -0.07039495557546616, - -0.07039495557546616 + 0.04693000018596649, + 0.04693000018596649, + -0.04693005979061127, + -0.04693005979061127 ], "y" : [ - -0.1890522241592407, - 0.1890524625778198, - 0.1890524625778198, - -0.1890522241592407 + -0.1895973682403564, + 0.1895966529846191, + 0.1895966529846191, + -0.1895973682403564 ] } } } ], "linearVelocity" : 0, - "massData-I" : 0.000722132739610970, + "massData-I" : 0.0004525946278590709, "massData-center" : { - "x" : 5.215406417846680e-08, - "y" : 1.192092824453539e-07 + "x" : -2.980232238769531e-08, + "y" : -3.576278686523438e-07 }, - "massData-mass" : 0.05323336645960808, - "name" : "upperLeftLeg", + "massData-mass" : 0.03559117391705513, + "name" : "upperRightArm", "position" : { - "x" : -0.06537666171789169, - "y" : 0.3381301760673523 + "x" : 0.09864036738872528, + "y" : 0.9068759679794312 }, "type" : 2 }, @@ -475,35 +431,75 @@ { "x" : [ - 0.07039496302604675, - 0.07039496302604675, - -0.07039486616849899, - -0.07039486616849899 + 0.04693000018596649, + 0.04693000018596649, + -0.04693005979061127, + -0.04693005979061127 ], "y" : [ - -0.09294389933347702, - 0.1276105940341949, - 0.1276105940341949, - -0.09294389933347702 + -0.1159216761589050, + 0.1159217953681946, + 0.1159217953681946, + -0.1159216761589050 ] } } } ], "linearVelocity" : 0, - "massData-I" : 0.0001864957448560745, + "massData-I" : 0.0001134485355578363, "massData-center" : { - "x" : 4.842877032729120e-08, - "y" : 0.01733334921300411 + "x" : -2.980232238769531e-08, + "y" : 5.960464477539062e-08 }, - "massData-mass" : 0.03105182945728302, - "name" : "lowerRightLeg", + "massData-mass" : 0.02176084183156490, + "name" : "lowerRightArm", "position" : { - "x" : 0.02818956598639488, - "y" : 0.1036150008440018 + "x" : 0.09864036738872528, + "y" : 0.6898344159126282 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "circle" : + { + "center" : + { + "x" : -0.01561669446527958, + "y" : 0.004700659774243832 + }, + "radius" : 0.2268356680870056 + }, + "density" : 0.2204959988594055, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture1" + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0009264730615541339, + "massData-center" : + { + "x" : -0.01561669446527958, + "y" : 0.004700659774243832 + }, + "massData-mass" : 0.03564291819930077, + "name" : "head", + "position" : + { + "x" : 0.009572610259056091, + "y" : 1.462979435920715 }, "type" : 2 } @@ -555,181 +551,6 @@ "joint" : [ - { - "anchorA" : - { - "x" : 0.06392270326614380, - "y" : 0.4330990314483643 - }, - "anchorB" : - { - "x" : 0.01330260001122952, - "y" : -0.2468919754028320 - }, - "bodyA" : 1, - "bodyB" : 2, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -0.6981316804885864, - "maxMotorTorque" : 0, - "motorSpeed" : 0, - "name" : "joint9", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 1.221730470657349 - }, - - { - "anchorA" : - { - "x" : 0.0008554458618164062, - "y" : -0.1461489200592041 - }, - "anchorB" : - { - "x" : 0.0008557140827178955, - "y" : 0.07089227437973022 - }, - "bodyA" : 0, - "bodyB" : 5, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -1.919862151145935, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint4", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 0.01745329238474369 - }, - - { - "anchorA" : - { - "x" : 0.0003538504242897034, - "y" : 0.07107692956924438 - }, - "anchorB" : - { - "x" : 0.0003536641597747803, - "y" : -0.1459646224975586 - }, - "bodyA" : 3, - "bodyB" : 6, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -1.919862151145935, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint1", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 0.01745329238474369 - }, - - { - "anchorA" : - { - "x" : 0.001979876309633255, - "y" : -0.1506856828927994 - }, - "anchorB" : - { - "x" : 0.001979988068342209, - "y" : 0.08382888138294220 - }, - "bodyA" : 7, - "bodyB" : 9, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : 0.01745329238474369, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint8", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 2.268928050994873 - }, - - { - "anchorA" : - { - "x" : -0.0007802918553352356, - "y" : -0.1484908312559128 - }, - "anchorB" : - { - "x" : -0.0007800981402397156, - "y" : 0.08614097535610199 - }, - "bodyA" : 8, - "bodyB" : 4, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : 0.01745329238474369, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint7", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 2.268928050994873 - }, - - { - "anchorA" : - { - "x" : -0.09517393261194229, - "y" : 0.2718780040740967 - }, - "anchorB" : - { - "x" : -1.741945743560791e-05, - "y" : 0.1479903459548950 - }, - "bodyA" : 1, - "bodyB" : 0, - "enableLimit" : false, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint3", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 3.141592741012573 - }, - - { - "anchorA" : - { - "x" : 0.1396137326955795, - "y" : 0.2701327800750732 - }, - "anchorB" : - { - "x" : -7.455050945281982e-05, - "y" : 0.1462446451187134 - }, - "bodyA" : 1, - "bodyB" : 6, - "enableLimit" : false, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint2", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 3.141592741012573 - }, - { "anchorA" : { @@ -741,8 +562,8 @@ "x" : -0.04493143409490585, "y" : 0.1559127867221832 }, - "bodyA" : 1, - "bodyB" : 8, + "bodyA" : 0, + "bodyB" : 3, "enableLimit" : true, "enableMotor" : false, "jointSpeed" : 0, @@ -766,8 +587,8 @@ "x" : 0.04127830639481544, "y" : 0.1504460573196411 }, - "bodyA" : 1, - "bodyB" : 7, + "bodyA" : 0, + "bodyB" : 6, "enableLimit" : true, "enableMotor" : false, "jointSpeed" : 0, @@ -778,6 +599,181 @@ "refAngle" : 0, "type" : "revolute", "upperLimit" : 1.919862151145935 + }, + + { + "anchorA" : + { + "x" : -0.0007802918553352356, + "y" : -0.1484908312559128 + }, + "anchorB" : + { + "x" : -0.0007800981402397156, + "y" : 0.08614097535610199 + }, + "bodyA" : 3, + "bodyB" : 4, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0.01745329238474369, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint7", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 2.268928050994873 + }, + + { + "anchorA" : + { + "x" : 0.001979876309633255, + "y" : -0.1506856828927994 + }, + "anchorB" : + { + "x" : 0.001979988068342209, + "y" : 0.08382888138294220 + }, + "bodyA" : 6, + "bodyB" : 2, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0.01745329238474369, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint8", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 2.268928050994873 + }, + + { + "anchorA" : + { + "x" : 0.0003538504242897034, + "y" : 0.07107692956924438 + }, + "anchorB" : + { + "x" : 0.0003536641597747803, + "y" : -0.1459646224975586 + }, + "bodyA" : 8, + "bodyB" : 7, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -1.919862151145935, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint1", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 0 + }, + + { + "anchorA" : + { + "x" : 0.06392270326614380, + "y" : 0.4330990314483643 + }, + "anchorB" : + { + "x" : 0.01330260001122952, + "y" : -0.2468919754028320 + }, + "bodyA" : 0, + "bodyB" : 9, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.6981316804885864, + "maxMotorTorque" : 0, + "motorSpeed" : 0, + "name" : "joint9", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.221730470657349 + }, + + { + "anchorA" : + { + "x" : 0.1396137326955795, + "y" : 0.2701327800750732 + }, + "anchorB" : + { + "x" : -7.455050945281982e-05, + "y" : 0.1462446451187134 + }, + "bodyA" : 0, + "bodyB" : 7, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint2", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : -0.09517393261194229, + "y" : 0.2718780040740967 + }, + "anchorB" : + { + "x" : -1.741945743560791e-05, + "y" : 0.1479903459548950 + }, + "bodyA" : 0, + "bodyB" : 1, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint3", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : 0.0008554458618164062, + "y" : -0.1461489200592041 + }, + "anchorB" : + { + "x" : 0.0008557140827178955, + "y" : 0.07089227437973022 + }, + "bodyA" : 1, + "bodyB" : 5, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -1.919862151145935, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint4", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 0.01745329238474369 } ], "positionIterations" : 3, diff --git a/app/Game/Channel/GameController.js b/app/Game/Channel/GameController.js index 571b088..6b3b1db 100755 --- a/app/Game/Channel/GameController.js +++ b/app/Game/Channel/GameController.js @@ -9,10 +9,10 @@ define([ "Game/Channel/Player", "Game/Channel/GameObjects/GameObject", "Game/Channel/GameObjects/Doll", - "Game/Channel/GameObjects/Items/RagDoll" + "Game/Channel/GameObjects/Items/RubeDoll" ], -function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, Nc, Box2D, Player, GameObject, Doll, RagDoll) { +function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, Nc, Box2D, Player, GameObject, Doll, RubeDoll) { "use strict"; @@ -172,7 +172,7 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N var objects = []; for (var i = 0; i < this.gameObjects.animated.length; i++) { - if(this.gameObjects.animated[i] instanceof RagDoll) { + if(this.gameObjects.animated[i] instanceof RubeDoll) { var object = this.gameObjects.animated[i]; var options = object.options; options.x = object.getPosition().x; diff --git a/app/Game/Channel/GameObjects/Items/RubeDoll.js b/app/Game/Channel/GameObjects/Items/RubeDoll.js index b810471..dfad73f 100644 --- a/app/Game/Channel/GameObjects/Items/RubeDoll.js +++ b/app/Game/Channel/GameObjects/Items/RubeDoll.js @@ -9,10 +9,20 @@ function (Parent, Settings, Nc) { "use strict"; function RubeDoll(physicsEngine, uid, options) { + this.scheduledForDestruction = false; + this.destructionTimeout = null; + Parent.call(this, physicsEngine, uid, options); } RubeDoll.prototype = Object.create(Parent.prototype); + + RubeDoll.prototype.beingGrabbed = function(player) { + Parent.prototype.beingGrabbed.call(this, player); + if(this.scheduledForDestruction) { + clearTimeout(this.destructionTimeout); + } + }; RubeDoll.prototype.beingReleased = function(player) { Parent.prototype.beingReleased.call(this, player); diff --git a/app/Game/Client/GameObjects/Items/RubeDoll.js b/app/Game/Client/GameObjects/Items/RubeDoll.js index 078fd9a..4075560 100644 --- a/app/Game/Client/GameObjects/Items/RubeDoll.js +++ b/app/Game/Client/GameObjects/Items/RubeDoll.js @@ -93,6 +93,7 @@ function (Parent, Layer, Settings, Nc) { this.limbMeshes = {}; this.baseMeshName = "chest"; this.characterName = "Chuck"; + this.lastFlipDirection = 1; Parent.call(this, physicsEngine, uid, options); } @@ -101,10 +102,8 @@ function (Parent, Layer, Settings, Nc) { RubeDoll.prototype.createMesh = function() { - this.createLimbMesh("lowerRightLeg"); this.createLimbMesh("upperRightLeg"); - this.createLimbMesh("lowerRightArm"); this.createLimbMesh("upperRightArm"); @@ -113,7 +112,6 @@ function (Parent, Layer, Settings, Nc) { this.createLimbMesh("lowerLeftLeg"); this.createLimbMesh("upperLeftLeg"); - this.createLimbMesh("lowerLeftArm"); this.createLimbMesh("upperLeftArm"); @@ -187,6 +185,48 @@ function (Parent, Layer, Settings, Nc) { }; RubeDoll.prototype.flip = function(direction) { + Parent.prototype.flip.call(this, direction); + + if(this.limbs) { + for(var name in this.limbMeshes) { + if(this.limbs[name]) { + Nc.trigger(Nc.ns.client.view.mesh.update, + this.layerId, + this.limbMeshes[name], + { + xScale: direction, + } + ); + } + } + } + + // flipping depth of right body side arm/leg images with left + if (this.lastFlipDirection != direction) { + + this.lastFlipDirection = direction; + + Nc.trigger(Nc.ns.client.view.mesh.swapMeshIndexes, + this.layerId, + this.limbMeshes["lowerRightLeg"], + this.limbMeshes["lowerLeftLeg"] + ); + Nc.trigger(Nc.ns.client.view.mesh.swapMeshIndexes, + this.layerId, + this.limbMeshes["upperRightLeg"], + this.limbMeshes["upperLeftLeg"] + ); + Nc.trigger(Nc.ns.client.view.mesh.swapMeshIndexes, + this.layerId, + this.limbMeshes["lowerRightArm"], + this.limbMeshes["lowerLeftArm"] + ); + Nc.trigger(Nc.ns.client.view.mesh.swapMeshIndexes, + this.layerId, + this.limbMeshes["upperRightArm"], + this.limbMeshes["upperLeftArm"] + ); + } }; return RubeDoll; diff --git a/app/Game/Client/View/LayerManager.js b/app/Game/Client/View/LayerManager.js index 3ad6dea..7adec2f 100644 --- a/app/Game/Client/View/LayerManager.js +++ b/app/Game/Client/View/LayerManager.js @@ -20,7 +20,8 @@ function (Nc, Exception, Layer) { Nc.on(Nc.ns.client.view.mesh.remove, this.removeMesh, this), Nc.on(Nc.ns.client.view.mesh.update, this.updateMesh, this), Nc.on(Nc.ns.client.view.mesh.addFilter, this.addFilter, this), - Nc.on(Nc.ns.client.view.mesh.removeFilter, this.removeFilter, this) + Nc.on(Nc.ns.client.view.mesh.removeFilter, this.removeFilter, this), + Nc.on(Nc.ns.client.view.mesh.swapMeshIndexes, this.swapMeshIndexes, this) ]; } @@ -157,6 +158,11 @@ function (Nc, Exception, Layer) { this.delegate.apply(this, arguments); }; + LayerManager.prototype.swapMeshIndexes = function() { + Array.prototype.splice.call(arguments, 0, 0, 'swapMeshIndexes') + this.delegate.apply(this, arguments); + }; + LayerManager.prototype.destroy = function() { for (var i = 0; i < this.ncTokens.length; i++) { Nc.off(this.ncTokens[i]); diff --git a/app/Game/Client/View/Pixi/Layer.js b/app/Game/Client/View/Pixi/Layer.js index acd0f98..58a0fd8 100644 --- a/app/Game/Client/View/Pixi/Layer.js +++ b/app/Game/Client/View/Pixi/Layer.js @@ -95,6 +95,14 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings, ColorConverter, Nc) { this.container.removeChild(mesh); }; + Layer.prototype.swapMeshIndexes = function(meshA, meshB) { + var indexA = this.container.getChildIndex(meshA); + var indexB = this.container.getChildIndex(meshB); + + this.container.setChildIndex(meshA, indexB); + this.container.setChildIndex(meshB, indexA); + }; + Layer.prototype.createMesh = function (texturePath, callback, options) { var texture = (options && options.fromFrame) diff --git a/app/Game/Core/GameObjects/Doll.js b/app/Game/Core/GameObjects/Doll.js index 8090fb8..7dd7780 100755 --- a/app/Game/Core/GameObjects/Doll.js +++ b/app/Game/Core/GameObjects/Doll.js @@ -40,7 +40,7 @@ function (Parent, Exception, Box2D, Settings, CollisionDetector, Item, Nc, Asser this.holdingJoint = null; this.holdingItem = null; - this.ragDoll = {head: null, body: null}; + this.ragDoll = {head: null, body: null}; // FIXME: wtf is this? can we remove it? this.createFixtures(); this.body.SetActive(false); diff --git a/app/Game/Core/GameObjects/Items/RubeDoll.js b/app/Game/Core/GameObjects/Items/RubeDoll.js index ea5b6c0..eeca209 100644 --- a/app/Game/Core/GameObjects/Items/RubeDoll.js +++ b/app/Game/Core/GameObjects/Items/RubeDoll.js @@ -18,10 +18,27 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { this.rubeLoader = null; this.body = null; this.limbs = {}; + this.joints = null; + this.limits = []; var chest = null; var world = physicsEngine.getWorld(); this.rubeLoader = new RubeLoader(RubeDollJson, world); + + this.loadRubeDollFromScene(options); + + Parent.call(this, physicsEngine, uid, options); + world.DestroyBody(this.body); + this.body = this.limbs.chest; + + this.body.SetUserData(this); + + this.flip(options.direction); + } + + RubeDoll.prototype = Object.create(Parent.prototype); + + RubeDoll.prototype.loadRubeDollFromScene = function(options) { var scene = this.rubeLoader.getScene(); for (var i in scene.bodies) { @@ -35,19 +52,17 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { this.limbs[body.name] = body; } - Parent.call(this, physicsEngine, uid, options); - world.DestroyBody(this.body); - this.body = this.limbs.chest; + this.joints = scene.joints; - var def = this.body.GetDefinition(); - def.userData = this; - this.body.SetUserData(this); - } - - RubeDoll.prototype = Object.create(Parent.prototype); + for (var i in this.joints) { + this.limits[i] = { + lower: this.joints[i].GetLowerLimit(), + upper: this.joints[i].GetUpperLimit(), + }; + } + }; RubeDoll.prototype.getFixtureDef = function() { - var fixtureDef = new Box2D.Dynamics.b2FixtureDef(); fixtureDef.shape = new Box2D.Collision.Shapes.b2CircleShape(); return fixtureDef; @@ -55,7 +70,28 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { RubeDoll.prototype.flip = function(direction) { Parent.prototype.flip.call(this, direction); - // Extend + + for (var i in this.joints) { + var joint = this.joints[i]; + var limits = this.limits[i]; + + if (joint instanceof Box2D.Dynamics.Joints.b2RevoluteJoint) { + + if (direction > 0) { + joint.SetLimits(limits.lower, limits.upper); + continue; + } + + var a1 = limits.lower * -1; + var a2 = limits.upper * -1; + + if (a2 > a1) { + joint.SetLimits(a1, a2); + } else { + joint.SetLimits(a2, a1); + } + } + } }; RubeDoll.prototype.reposition = function(handPosition, direction) { diff --git a/app/Game/Core/Player.js b/app/Game/Core/Player.js index 67b492b..d40a748 100755 --- a/app/Game/Core/Player.js +++ b/app/Game/Core/Player.js @@ -129,22 +129,23 @@ function (Doll, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll image: "chest.png", name: "RagDoll", rotation: 0, - type: "ragdoll", + type: "rubedoll", weight: 3, width: 5, height: 12, - primaryColor: primaryColor + primaryColor: primaryColor, + direction: this.doll.lookDirection }; - var ragDoll = new RubeDoll(this.physicsEngine, "ragDoll-" + this.id + "-" + ragDollId, options); - ragDoll.setVelocities(this.doll.getVelocities()); + var rubeDoll = new RubeDoll(this.physicsEngine, "rubeDoll-" + this.id + "-" + ragDollId, options); + rubeDoll.setVelocities(this.doll.getVelocities()); this.spawned = false; this.doll.destroy(); this.doll = null; - this.ragDoll = ragDoll; + this.ragDoll = rubeDoll; }; Player.prototype.update = function () { diff --git a/app/Lib/Utilities/NotificationCenter.js b/app/Lib/Utilities/NotificationCenter.js index 33f8eb7..ec4beb3 100755 --- a/app/Lib/Utilities/NotificationCenter.js +++ b/app/Lib/Utilities/NotificationCenter.js @@ -41,7 +41,8 @@ function (Exception) { remove: null, update: null, addFilter: null, - removeFilter: null + removeFilter: null, + swapMeshIndexes: null }, animatedMesh: { create: null diff --git a/app/Lib/Vendor/RubeLoader.js b/app/Lib/Vendor/RubeLoader.js index 2b6d5a1..b1f3b83 100644 --- a/app/Lib/Vendor/RubeLoader.js +++ b/app/Lib/Vendor/RubeLoader.js @@ -426,7 +426,7 @@ function (Box2D) { var scene = { bodies: loadedBodies, - // joints: loadedJoints + joints: loadedJoints }; return scene; diff --git a/static/items/rube/ragdoll.rube b/static/items/rube/ragdoll.rube index b7f646a..5a3b727 100644 --- a/static/items/rube/ragdoll.rube +++ b/static/items/rube/ragdoll.rube @@ -482,18 +482,18 @@ ], "vertices" : { - "x" : [ -0.002679032273590565 ], - "y" : [ 0.004700660705566406 ] + "x" : [ -0.01561669446527958 ], + "y" : [ 0.004700659774243832 ] } } ], "id" : 8, "linearVelocity" : 0, - "massData-I" : 0.0009180362685583532, + "massData-I" : 0.0009264730615541339, "massData-center" : { - "x" : -0.002679032273590565, - "y" : 0.004700660705566406 + "x" : -0.01561669446527958, + "y" : 0.004700659774243832 }, "massData-mass" : 0.03564291819930077, "name" : "head", @@ -516,8 +516,8 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "id" : 13, - "name" : "fixture0", + "id" : 11, + "name" : "fixture2", "shapes" : [ @@ -529,34 +529,30 @@ { "x" : [ - 0.1402979493141174, - 0.1375417709350586, - 0.001378186047077179, - -0.1402979493141174, - -0.1402979493141174, - 0.001192390918731689 + -0.1156365871429443, + 0.1570904254913330, + 0.1570904254913330, + -0.1156365871429443 ], "y" : [ - -0.3207050263881683, - 0.4018019437789917, - 0.4018019437789917, - 0.3136067390441895, - -0.3432337343692780, - -0.3689299821853638 + -0.3584164977073669, + -0.3584164977073669, + 0.4034895300865173, + 0.4034895300865173 ] } } ], "id" : 9, "linearVelocity" : 0, - "massData-I" : 0.01047351956367493, + "massData-I" : 0.01153474207967520, "massData-center" : { - "x" : 0.001456731930375099, - "y" : 0.01425695233047009 + "x" : 0.02072691917419434, + "y" : 0.02253651618957520 }, - "massData-mass" : 0.2038488984107971, + "massData-mass" : 0.2077923566102982, "name" : "chest", "position" : { @@ -701,7 +697,7 @@ "name" : "joint1", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 0.01745329238474369 + "upperLimit" : 0 }, { @@ -747,13 +743,13 @@ "enableLimit" : true, "enableMotor" : false, "id" : 5, - "lowerLimit" : -0.6981316804885864, + "lowerLimit" : -0.7853981852531433, "maxMotorTorque" : 1, "motorSpeed" : 0, "name" : "joint6", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 1.919862151145935 + "upperLimit" : 1.570796370506287 }, { @@ -773,13 +769,13 @@ "enableLimit" : true, "enableMotor" : false, "id" : 6, - "lowerLimit" : -0.6981316804885864, + "lowerLimit" : -0.7853981852531433, "maxMotorTorque" : 1, "motorSpeed" : 0, "name" : "joint5", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 1.919862151145935 + "upperLimit" : 1.570796370506287 }, { From 8e70eedbce06cb041c2976a6ccd6244e8b063804 Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 4 May 2015 14:01:23 +0200 Subject: [PATCH 26/68] added setting to switch off pointer lock filter --- app/Game/Client/View/Pixi/View.js | 5 ++++- app/Game/Config/Settings.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Game/Client/View/Pixi/View.js b/app/Game/Client/View/Pixi/View.js index d191bae..62c2fc5 100755 --- a/app/Game/Client/View/Pixi/View.js +++ b/app/Game/Client/View/Pixi/View.js @@ -121,7 +121,8 @@ function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, Layer } PixiView.prototype.initPointerLockView = function() { - + if (!Settings.ENABLE_POINTER_LOCK_FILTER) return; + var blurFilter = new PIXI.BlurFilter(); blurFilter.blurX = 42 * this.currentZoom; blurFilter.blurY = 42 * this.currentZoom; @@ -139,6 +140,8 @@ function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, Layer }; PixiView.prototype.onPointerLockChange = function(isLocked, options) { + if (!Settings.ENABLE_POINTER_LOCK_FILTER) return; + if(isLocked) { this.container.filters = null; this.clickToEnable.visible = false; diff --git a/app/Game/Config/Settings.js b/app/Game/Config/Settings.js index 4e93113..0771d84 100755 --- a/app/Game/Config/Settings.js +++ b/app/Game/Config/Settings.js @@ -39,6 +39,7 @@ function () { VIEW_CONTROLLER: 0 ? "Three" : "Pixi", ARROW_GLIDE: 30, // % of the way per frame SHOW_LAYER_INFO: false, + ENABLE_POINTER_LOCK_FILTER: false, // GAME PLAY WALK_SPEED: 4, From cb23c1fb059d14c78e24d5c9ce37d532fc41cdee Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 4 May 2015 14:02:53 +0200 Subject: [PATCH 27/68] centered rubedoll head --- app/Game/Asset/RubeDoll.json | 942 ++++++++++++++++----------------- static/items/rube/ragdoll.rube | 72 +-- 2 files changed, 507 insertions(+), 507 deletions(-) diff --git a/app/Game/Asset/RubeDoll.json b/app/Game/Asset/RubeDoll.json index 37e4c0e..6f526a2 100644 --- a/app/Game/Asset/RubeDoll.json +++ b/app/Game/Asset/RubeDoll.json @@ -5,57 +5,6 @@ "body" : [ - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture2", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.1570904254913330, - 0.1570904254913330, - -0.1156365871429443, - -0.1156365871429443 - ], - "y" : - [ - -0.3584164977073669, - 0.4034895300865173, - 0.4034895300865173, - -0.3584164977073669 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.01153474207967520, - "massData-center" : - { - "x" : 0.02072691917419434, - "y" : 0.02253651618957520 - }, - "massData-mass" : 0.2077923566102982, - "name" : "chest", - "position" : - { - "x" : -0.04104747623205185, - "y" : 0.7829875946044922 - }, - "type" : 2 - }, - { "angle" : 0, "angularVelocity" : 0, @@ -101,8 +50,8 @@ "name" : "upperLeftArm", "position" : { - "x" : -0.1362041532993317, - "y" : 0.9068759679794312 + "x" : -0.1165364086627960, + "y" : 0.9012566804885864 }, "type" : 2 }, @@ -118,42 +67,42 @@ "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "name" : "fixture3", + "name" : "fixture2", "polygon" : { "vertices" : { "x" : [ - 0.07039496302604675, - 0.07039496302604675, - -0.07039486616849899, - -0.07039486616849899 + 0.1570899933576584, + 0.1570899933576584, + -0.1156369969248772, + -0.1156369969248772 ], "y" : [ - -0.09294389933347702, - 0.1276105940341949, - 0.1276105940341949, - -0.09294389933347702 + -0.3584159910678864, + 0.4034900069236755, + 0.4034900069236755, + -0.3584159910678864 ] } } } ], "linearVelocity" : 0, - "massData-I" : 0.0001864957448560745, + "massData-I" : 0.01153474114835262, "massData-center" : { - "x" : 4.842877032729120e-08, - "y" : 0.01733334921300411 + "x" : 0.02072649449110031, + "y" : 0.02253700792789459 }, - "massData-mass" : 0.03105182945728302, - "name" : "lowerRightLeg", + "massData-mass" : 0.2077923268079758, + "name" : "chest", "position" : { - "x" : 0.02818956598639488, - "y" : 0.1036150008440018 + "x" : -0.02137973159551620, + "y" : 0.7773683071136475 }, "type" : 2 }, @@ -166,249 +115,34 @@ [ { - "density" : 1, + "circle" : + { + "center" : + { + "x" : -0.01561669446527958, + "y" : 0.004700659774243832 + }, + "radius" : 0.2268356680870056 + }, + "density" : 0.2204959988594055, "filter-groupIndex" : -55, "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.07039505988359451, - 0.07039505988359451, - -0.07039495557546616, - -0.07039495557546616 - ], - "y" : - [ - -0.1890522241592407, - 0.1890524625778198, - 0.1890524625778198, - -0.1890522241592407 - ] - } - } + "name" : "fixture1" } ], "linearVelocity" : 0, - "massData-I" : 0.000722132739610970, + "massData-I" : 0.0009264730615541339, "massData-center" : { - "x" : 5.215406417846680e-08, - "y" : 1.192092824453539e-07 + "x" : -0.01561669446527958, + "y" : 0.004700659774243832 }, - "massData-mass" : 0.05323336645960808, - "name" : "upperLeftLeg", + "massData-mass" : 0.03564291819930077, + "name" : "head", "position" : { - "x" : -0.06537666171789169, - "y" : 0.3381301760673523 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.07039503753185272, - 0.07039503753185272, - -0.07039495557546616, - -0.07039495557546616 - ], - "y" : - [ - -0.09294363856315613, - 0.1277718394994736, - 0.1277718394994736, - -0.09294363856315613 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0001869033440016210, - "massData-center" : - { - "x" : 4.097818973036738e-08, - "y" : 0.01741409860551357 - }, - "massData-mass" : 0.03107452951371670, - "name" : "lowerLeftLeg", - "position" : - { - "x" : -0.06537666171789169, - "y" : 0.1036150008440018 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.04693000763654709, - 0.04693000763654709, - -0.04692991077899933, - -0.04692991077899933 - ], - "y" : - [ - -0.1159216761589050, - 0.1159217953681946, - 0.1159217953681946, - -0.1159216761589050 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0001134483172791079, - "massData-center" : - { - "x" : 4.842877032729120e-08, - "y" : 5.960464477539062e-08 - }, - "massData-mass" : 0.02176081016659737, - "name" : "lowerLeftArm", - "position" : - { - "x" : -0.1362059414386749, - "y" : 0.6898344159126282 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.07039496302604675, - 0.07039496302604675, - -0.07039486616849899, - -0.07039486616849899 - ], - "y" : - [ - -0.1890522241592407, - 0.1890524625778198, - 0.1890524625778198, - -0.1890522241592407 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0007221315754577518, - "massData-center" : - { - "x" : 4.842877388000488e-08, - "y" : 1.192092895507812e-07 - }, - "massData-mass" : 0.05323329567909241, - "name" : "upperRightLeg", - "position" : - { - "x" : 0.02818956598639488, - "y" : 0.3381301760673523 - }, - "type" : 2 - }, - - { - "angle" : 0, - "angularVelocity" : 0, - "awake" : true, - "fixture" : - [ - - { - "density" : 1, - "filter-groupIndex" : -55, - "friction" : 0.2, - "name" : "fixture3", - "polygon" : - { - "vertices" : - { - "x" : - [ - 0.04693000018596649, - 0.04693000018596649, - -0.04693005979061127, - -0.04693005979061127 - ], - "y" : - [ - -0.1895973682403564, - 0.1895966529846191, - 0.1895966529846191, - -0.1895973682403564 - ] - } - } - } - ], - "linearVelocity" : 0, - "massData-I" : 0.0004525946278590709, - "massData-center" : - { - "x" : -2.980232238769531e-08, - "y" : -3.576278686523438e-07 - }, - "massData-mass" : 0.03559117391705513, - "name" : "upperRightArm", - "position" : - { - "x" : 0.09864036738872528, - "y" : 0.9068759679794312 + "x" : 0.02309736609458923, + "y" : 1.497289657592773 }, "type" : 2 }, @@ -458,8 +192,8 @@ "name" : "lowerRightArm", "position" : { - "x" : 0.09864036738872528, - "y" : 0.6898344159126282 + "x" : 0.1183081120252609, + "y" : 0.6842151284217834 }, "type" : 2 }, @@ -472,34 +206,300 @@ [ { - "circle" : - { - "center" : - { - "x" : -0.01561669446527958, - "y" : 0.004700659774243832 - }, - "radius" : 0.2268356680870056 - }, - "density" : 0.2204959988594055, + "density" : 1, "filter-groupIndex" : -55, "friction" : 0.2, - "name" : "fixture1" + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.07039503753185272, + 0.07039503753185272, + -0.07039495557546616, + -0.07039495557546616 + ], + "y" : + [ + -0.09294363856315613, + 0.1277718394994736, + 0.1277718394994736, + -0.09294363856315613 + ] + } + } } ], "linearVelocity" : 0, - "massData-I" : 0.0009264730615541339, + "massData-I" : 0.0001869033440016210, "massData-center" : { - "x" : -0.01561669446527958, - "y" : 0.004700659774243832 + "x" : 4.097818973036738e-08, + "y" : 0.01741409860551357 }, - "massData-mass" : 0.03564291819930077, - "name" : "head", + "massData-mass" : 0.03107452951371670, + "name" : "lowerLeftLeg", "position" : { - "x" : 0.009572610259056091, - "y" : 1.462979435920715 + "x" : -0.04570891708135605, + "y" : 0.09799571335315704 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.04693000763654709, + 0.04693000763654709, + -0.04692991077899933, + -0.04692991077899933 + ], + "y" : + [ + -0.1159216761589050, + 0.1159217953681946, + 0.1159217953681946, + -0.1159216761589050 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0001134483172791079, + "massData-center" : + { + "x" : 4.842877032729120e-08, + "y" : 5.960464477539062e-08 + }, + "massData-mass" : 0.02176081016659737, + "name" : "lowerLeftArm", + "position" : + { + "x" : -0.1165381968021393, + "y" : 0.6842151284217834 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.04693000018596649, + 0.04693000018596649, + -0.04693005979061127, + -0.04693005979061127 + ], + "y" : + [ + -0.1895973682403564, + 0.1895966529846191, + 0.1895966529846191, + -0.1895973682403564 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0004525946278590709, + "massData-center" : + { + "x" : -2.980232238769531e-08, + "y" : -3.576278686523438e-07 + }, + "massData-mass" : 0.03559117391705513, + "name" : "upperRightArm", + "position" : + { + "x" : 0.1183081120252609, + "y" : 0.9012566804885864 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.07039496302604675, + 0.07039496302604675, + -0.07039486616849899, + -0.07039486616849899 + ], + "y" : + [ + -0.1890522241592407, + 0.1890524625778198, + 0.1890524625778198, + -0.1890522241592407 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0007221315754577518, + "massData-center" : + { + "x" : 4.842877388000488e-08, + "y" : 1.192092895507812e-07 + }, + "massData-mass" : 0.05323329567909241, + "name" : "upperRightLeg", + "position" : + { + "x" : 0.04785731062293053, + "y" : 0.3325108885765076 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.07039505988359451, + 0.07039505988359451, + -0.07039495557546616, + -0.07039495557546616 + ], + "y" : + [ + -0.1890522241592407, + 0.1890524625778198, + 0.1890524625778198, + -0.1890522241592407 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.000722132739610970, + "massData-center" : + { + "x" : 5.215406417846680e-08, + "y" : 1.192092824453539e-07 + }, + "massData-mass" : 0.05323336645960808, + "name" : "upperLeftLeg", + "position" : + { + "x" : -0.04570891708135605, + "y" : 0.3325108885765076 + }, + "type" : 2 + }, + + { + "angle" : 0, + "angularVelocity" : 0, + "awake" : true, + "fixture" : + [ + + { + "density" : 1, + "filter-groupIndex" : -55, + "friction" : 0.2, + "name" : "fixture3", + "polygon" : + { + "vertices" : + { + "x" : + [ + 0.07039496302604675, + 0.07039496302604675, + -0.07039486616849899, + -0.07039486616849899 + ], + "y" : + [ + -0.09294389933347702, + 0.1276105940341949, + 0.1276105940341949, + -0.09294389933347702 + ] + } + } + } + ], + "linearVelocity" : 0, + "massData-I" : 0.0001864957448560745, + "massData-center" : + { + "x" : 4.842877032729120e-08, + "y" : 0.01733334921300411 + }, + "massData-mass" : 0.03105182945728302, + "name" : "lowerRightLeg", + "position" : + { + "x" : 0.04785731062293053, + "y" : 0.09799571335315704 }, "type" : 2 } @@ -554,144 +554,19 @@ { "anchorA" : { - "x" : -0.06799929589033127, - "y" : -0.2890855073928833 + "x" : 0.02210754156112671, + "y" : 0.4607425928115845 }, "anchorB" : { - "x" : -0.04493143409490585, - "y" : 0.1559127867221832 + "x" : -0.02544101513922215, + "y" : -0.2591779232025146 }, - "bodyA" : 0, - "bodyB" : 3, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -0.6981316804885864, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint6", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 1.919862151145935 - }, - - { - "anchorA" : - { - "x" : 0.1116365119814873, - "y" : -0.2944114208221436 - }, - "anchorB" : - { - "x" : 0.04127830639481544, - "y" : 0.1504460573196411 - }, - "bodyA" : 0, - "bodyB" : 6, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -0.6981316804885864, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint5", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 1.919862151145935 - }, - - { - "anchorA" : - { - "x" : -0.0007802918553352356, - "y" : -0.1484908312559128 - }, - "anchorB" : - { - "x" : -0.0007800981402397156, - "y" : 0.08614097535610199 - }, - "bodyA" : 3, - "bodyB" : 4, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : 0.01745329238474369, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint7", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 2.268928050994873 - }, - - { - "anchorA" : - { - "x" : 0.001979876309633255, - "y" : -0.1506856828927994 - }, - "anchorB" : - { - "x" : 0.001979988068342209, - "y" : 0.08382888138294220 - }, - "bodyA" : 6, + "bodyA" : 1, "bodyB" : 2, "enableLimit" : true, "enableMotor" : false, "jointSpeed" : 0, - "lowerLimit" : 0.01745329238474369, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint8", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 2.268928050994873 - }, - - { - "anchorA" : - { - "x" : 0.0003538504242897034, - "y" : 0.07107692956924438 - }, - "anchorB" : - { - "x" : 0.0003536641597747803, - "y" : -0.1459646224975586 - }, - "bodyA" : 8, - "bodyB" : 7, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -1.919862151145935, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint1", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 0 - }, - - { - "anchorA" : - { - "x" : 0.06392270326614380, - "y" : 0.4330990314483643 - }, - "anchorB" : - { - "x" : 0.01330260001122952, - "y" : -0.2468919754028320 - }, - "bodyA" : 0, - "bodyB" : 9, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, "lowerLimit" : -0.6981316804885864, "maxMotorTorque" : 0, "motorSpeed" : 0, @@ -704,32 +579,32 @@ { "anchorA" : { - "x" : 0.1396137326955795, - "y" : 0.2701327800750732 + "x" : 0.0008554458618164062, + "y" : -0.1461489200592041 }, "anchorB" : { - "x" : -7.455050945281982e-05, - "y" : 0.1462446451187134 + "x" : 0.0008557140827178955, + "y" : 0.07089227437973022 }, "bodyA" : 0, - "bodyB" : 7, - "enableLimit" : false, + "bodyB" : 5, + "enableLimit" : true, "enableMotor" : false, "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, + "lowerLimit" : -1.919862151145935, "maxMotorTorque" : 1, "motorSpeed" : 0, - "name" : "joint2", + "name" : "joint4", "refAngle" : 0, "type" : "revolute", - "upperLimit" : 3.141592741012573 + "upperLimit" : 0.01745329238474369 }, { "anchorA" : { - "x" : -0.09517393261194229, + "x" : -0.09517394006252289, "y" : 0.2718780040740967 }, "anchorB" : @@ -737,8 +612,8 @@ "x" : -1.741945743560791e-05, "y" : 0.1479903459548950 }, - "bodyA" : 0, - "bodyB" : 1, + "bodyA" : 1, + "bodyB" : 0, "enableLimit" : false, "enableMotor" : false, "jointSpeed" : 0, @@ -754,26 +629,151 @@ { "anchorA" : { - "x" : 0.0008554458618164062, - "y" : -0.1461489200592041 + "x" : 0.1116365119814873, + "y" : -0.2944114208221436 }, "anchorB" : { - "x" : 0.0008557140827178955, - "y" : 0.07089227437973022 + "x" : 0.04127830639481544, + "y" : 0.1504460573196411 }, "bodyA" : 1, - "bodyB" : 5, + "bodyB" : 7, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.7853981852531433, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint5", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.570796370506287 + }, + + { + "anchorA" : + { + "x" : -0.06799929589033127, + "y" : -0.2890855073928833 + }, + "anchorB" : + { + "x" : -0.04493143409490585, + "y" : 0.1559127867221832 + }, + "bodyA" : 1, + "bodyB" : 8, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.7853981852531433, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint6", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.570796370506287 + }, + + { + "anchorA" : + { + "x" : 0.1396137326955795, + "y" : 0.2701327800750732 + }, + "anchorB" : + { + "x" : -7.455050945281982e-05, + "y" : 0.1462446451187134 + }, + "bodyA" : 1, + "bodyB" : 6, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint2", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : 0.0003538504242897034, + "y" : 0.07107692956924438 + }, + "anchorB" : + { + "x" : 0.0003536641597747803, + "y" : -0.1459646224975586 + }, + "bodyA" : 3, + "bodyB" : 6, "enableLimit" : true, "enableMotor" : false, "jointSpeed" : 0, "lowerLimit" : -1.919862151145935, "maxMotorTorque" : 1, "motorSpeed" : 0, - "name" : "joint4", + "name" : "joint1", "refAngle" : 0, "type" : "revolute", - "upperLimit" : 0.01745329238474369 + "upperLimit" : 0 + }, + + { + "anchorA" : + { + "x" : 0.001979876309633255, + "y" : -0.1506856828927994 + }, + "anchorB" : + { + "x" : 0.001979988068342209, + "y" : 0.08382888138294220 + }, + "bodyA" : 7, + "bodyB" : 9, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0.01745329238474369, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint8", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 2.268928050994873 + }, + + { + "anchorA" : + { + "x" : -0.0007802955806255341, + "y" : -0.1484908312559128 + }, + "anchorB" : + { + "x" : -0.0007801018655300140, + "y" : 0.08614097535610199 + }, + "bodyA" : 8, + "bodyB" : 4, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0.01745329238474369, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint7", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 2.268928050994873 } ], "positionIterations" : 3, diff --git a/static/items/rube/ragdoll.rube b/static/items/rube/ragdoll.rube index 5a3b727..7024172 100644 --- a/static/items/rube/ragdoll.rube +++ b/static/items/rube/ragdoll.rube @@ -111,8 +111,8 @@ "name" : "lowerRightLeg", "position" : { - "x" : 0.02818956598639488, - "y" : 0.1036150008440018 + "x" : 0.04785731062293053, + "y" : 0.09799571335315704 }, "type" : "dynamic" }, @@ -168,8 +168,8 @@ "name" : "upperLeftLeg", "position" : { - "x" : -0.06537666171789169, - "y" : 0.3381301760673523 + "x" : -0.04570891708135605, + "y" : 0.3325108885765076 }, "type" : "dynamic" }, @@ -225,8 +225,8 @@ "name" : "upperRightLeg", "position" : { - "x" : 0.02818956598639488, - "y" : 0.3381301760673523 + "x" : 0.04785731062293053, + "y" : 0.3325108885765076 }, "type" : "dynamic" }, @@ -282,8 +282,8 @@ "name" : "upperRightArm", "position" : { - "x" : 0.09864036738872528, - "y" : 0.9068759679794312 + "x" : 0.1183081120252609, + "y" : 0.9012566804885864 }, "type" : "dynamic" }, @@ -339,8 +339,8 @@ "name" : "lowerLeftArm", "position" : { - "x" : -0.1362059414386749, - "y" : 0.6898344159126282 + "x" : -0.1165381968021393, + "y" : 0.6842151284217834 }, "type" : "dynamic" }, @@ -396,8 +396,8 @@ "name" : "lowerLeftLeg", "position" : { - "x" : -0.06537666171789169, - "y" : 0.1036150008440018 + "x" : -0.04570891708135605, + "y" : 0.09799571335315704 }, "type" : "dynamic" }, @@ -453,8 +453,8 @@ "name" : "lowerRightArm", "position" : { - "x" : 0.09864036738872528, - "y" : 0.6898344159126282 + "x" : 0.1183081120252609, + "y" : 0.6842151284217834 }, "type" : "dynamic" }, @@ -499,8 +499,8 @@ "name" : "head", "position" : { - "x" : 0.009572610259056091, - "y" : 1.462979435920715 + "x" : 0.02309736609458923, + "y" : 1.497289657592773 }, "type" : "dynamic" }, @@ -529,35 +529,35 @@ { "x" : [ - -0.1156365871429443, - 0.1570904254913330, - 0.1570904254913330, - -0.1156365871429443 + -0.1156369969248772, + 0.1570899933576584, + 0.1570899933576584, + -0.1156369969248772 ], "y" : [ - -0.3584164977073669, - -0.3584164977073669, - 0.4034895300865173, - 0.4034895300865173 + -0.3584159910678864, + -0.3584159910678864, + 0.4034900069236755, + 0.4034900069236755 ] } } ], "id" : 9, "linearVelocity" : 0, - "massData-I" : 0.01153474207967520, + "massData-I" : 0.01153474114835262, "massData-center" : { - "x" : 0.02072691917419434, - "y" : 0.02253651618957520 + "x" : 0.02072649449110031, + "y" : 0.02253700792789459 }, - "massData-mass" : 0.2077923566102982, + "massData-mass" : 0.2077923268079758, "name" : "chest", "position" : { - "x" : -0.04104747623205185, - "y" : 0.7829875946044922 + "x" : -0.02137973159551620, + "y" : 0.7773683071136475 }, "type" : "dynamic" }, @@ -613,8 +613,8 @@ "name" : "upperLeftArm", "position" : { - "x" : -0.1362041532993317, - "y" : 0.9068759679794312 + "x" : -0.1165364086627960, + "y" : 0.9012566804885864 }, "type" : "dynamic" } @@ -833,13 +833,13 @@ { "anchorA" : { - "x" : 0.06392270326614380, - "y" : 0.4330990016460419 + "x" : 0.02210754156112671, + "y" : 0.4607425630092621 }, "anchorB" : { - "x" : 0.01330260001122952, - "y" : -0.2468920052051544 + "x" : -0.02544101513922215, + "y" : -0.2591779530048370 }, "bodyA" : 9, "bodyB" : 8, From 7115292384b4269f723d36422d46669e9889e96a Mon Sep 17 00:00:00 2001 From: logsol Date: Wed, 6 May 2015 20:11:12 +0200 Subject: [PATCH 28/68] added possibility to not debug-draw sensor shapes --- app/Lib/Vendor/Box2D.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Lib/Vendor/Box2D.js b/app/Lib/Vendor/Box2D.js index 0e1e7c5..760681d 100755 --- a/app/Lib/Vendor/Box2D.js +++ b/app/Lib/Vendor/Box2D.js @@ -6006,6 +6006,10 @@ Box2D.postDefs = []; xf = b.m_xf; for (f = b.GetFixtureList(); f; f = f.m_next) { + // Disable drawing sensors by removing false || + if (false || f.IsSensor()) { + continue; + } s = f.GetShape(); if (b.IsActive() == false) { color.Set(0.5, 0.5, 0.3); From f1197b3045a7669e9c82ffbef32e9bf6ad5aedde Mon Sep 17 00:00:00 2001 From: logsol Date: Wed, 6 May 2015 20:13:13 +0200 Subject: [PATCH 29/68] added swapMeshes method to swap textures of 2 meshes --- app/Game/Client/View/LayerManager.js | 8 +++++++- app/Game/Client/View/Pixi/Layer.js | 16 ++++++++++++++++ app/Lib/Utilities/NotificationCenter.js | 3 ++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/app/Game/Client/View/LayerManager.js b/app/Game/Client/View/LayerManager.js index 7adec2f..8245e3f 100644 --- a/app/Game/Client/View/LayerManager.js +++ b/app/Game/Client/View/LayerManager.js @@ -21,7 +21,8 @@ function (Nc, Exception, Layer) { Nc.on(Nc.ns.client.view.mesh.update, this.updateMesh, this), Nc.on(Nc.ns.client.view.mesh.addFilter, this.addFilter, this), Nc.on(Nc.ns.client.view.mesh.removeFilter, this.removeFilter, this), - Nc.on(Nc.ns.client.view.mesh.swapMeshIndexes, this.swapMeshIndexes, this) + Nc.on(Nc.ns.client.view.mesh.swapMeshIndexes, this.swapMeshIndexes, this), + Nc.on(Nc.ns.client.view.mesh.swapMeshes, this.swapMeshes, this) ]; } @@ -163,6 +164,11 @@ function (Nc, Exception, Layer) { this.delegate.apply(this, arguments); }; + LayerManager.prototype.swapMeshes = function() { + Array.prototype.splice.call(arguments, 0, 0, 'swapMeshes') + this.delegate.apply(this, arguments); + }; + LayerManager.prototype.destroy = function() { for (var i = 0; i < this.ncTokens.length; i++) { Nc.off(this.ncTokens[i]); diff --git a/app/Game/Client/View/Pixi/Layer.js b/app/Game/Client/View/Pixi/Layer.js index 58a0fd8..4d6465f 100644 --- a/app/Game/Client/View/Pixi/Layer.js +++ b/app/Game/Client/View/Pixi/Layer.js @@ -103,6 +103,22 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings, ColorConverter, Nc) { this.container.setChildIndex(meshB, indexA); }; + Layer.prototype.swapMeshes = function(meshA, meshB) { + var textureA = meshA.texture; + var textureB = meshB.texture; + + meshA.setTexture(textureB); + meshA.onTextureUpdate(); + meshA.scale.x = 1; + meshA.scale.y = 1; + + meshB.setTexture(textureA); + meshB.onTextureUpdate(); + meshB.scale.x = 1; + meshB.scale.y = 1; + + }; + Layer.prototype.createMesh = function (texturePath, callback, options) { var texture = (options && options.fromFrame) diff --git a/app/Lib/Utilities/NotificationCenter.js b/app/Lib/Utilities/NotificationCenter.js index ec4beb3..62496ba 100755 --- a/app/Lib/Utilities/NotificationCenter.js +++ b/app/Lib/Utilities/NotificationCenter.js @@ -42,7 +42,8 @@ function (Exception) { update: null, addFilter: null, removeFilter: null, - swapMeshIndexes: null + swapMeshIndexes: null, + swapMeshes: null }, animatedMesh: { create: null From 5b68f7e2b625c9b845b5bc053c174d2f45d2676f Mon Sep 17 00:00:00 2001 From: logsol Date: Wed, 6 May 2015 20:15:22 +0200 Subject: [PATCH 30/68] improving rube doll flipping behaviour and positioning --- app/Game/Asset/RubeDoll.json | 474 +++++++++--------- app/Game/Client/GameObjects/Items/RubeDoll.js | 58 ++- app/Game/Core/GameObjects/Items/RubeDoll.js | 13 +- static/img/Characters/Chuck/lowerLeftArm.png | Bin 148 -> 2776 bytes static/img/Characters/Chuck/lowerLeftLeg.png | Bin 158 -> 2785 bytes static/img/Characters/Chuck/lowerRightArm.png | Bin 148 -> 2776 bytes static/img/Characters/Chuck/lowerRightLeg.png | Bin 158 -> 2785 bytes static/img/Characters/Chuck/upperLeftArm.png | Bin 145 -> 2793 bytes static/img/Characters/Chuck/upperRightArm.png | Bin 170 -> 2793 bytes static/img/Characters/Chuck/upperRightLeg.png | Bin 2866 -> 2822 bytes static/items/rube/ragdoll.rube | 198 ++++---- 11 files changed, 383 insertions(+), 360 deletions(-) diff --git a/app/Game/Asset/RubeDoll.json b/app/Game/Asset/RubeDoll.json index 6f526a2..a7b9312 100644 --- a/app/Game/Asset/RubeDoll.json +++ b/app/Game/Asset/RubeDoll.json @@ -23,17 +23,17 @@ { "x" : [ - 0.04692991077899933, - 0.04692991077899933, - -0.04692997038364410, - -0.04692997038364410 + 0.04692989960312843, + 0.04692989960312843, + -0.04693000018596649, + -0.04693000018596649 ], "y" : [ - -0.1895973682403564, - 0.1895966529846191, - 0.1895966529846191, - -0.1895973682403564 + -0.1895969957113266, + 0.1895969957113266, + 0.1895969957113266, + -0.1895969957113266 ] } } @@ -43,15 +43,15 @@ "massData-I" : 0.0004525936674326658, "massData-center" : { - "x" : -2.980232238769531e-08, - "y" : -3.576278686523438e-07 + "x" : -5.029141902923584e-08, + "y" : 0 }, "massData-mass" : 0.03559110686182976, "name" : "upperLeftArm", "position" : { - "x" : -0.1165364086627960, - "y" : 0.9012566804885864 + "x" : -0.1165359988808632, + "y" : 0.9012569785118103 }, "type" : 2 }, @@ -74,35 +74,35 @@ { "x" : [ - 0.1570899933576584, - 0.1570899933576584, - -0.1156369969248772, - -0.1156369969248772 + 0.1366278976202011, + 0.1366278976202011, + -0.1360991001129150, + -0.1360991001129150 ], "y" : [ - -0.3584159910678864, - 0.4034900069236755, - 0.4034900069236755, - -0.3584159910678864 + -0.3788780868053436, + 0.3830279111862183, + 0.3830279111862183, + -0.3788780868053436 ] } } } ], "linearVelocity" : 0, - "massData-I" : 0.01153474114835262, + "massData-I" : 0.01134084537625313, "massData-center" : { - "x" : 0.02072649449110031, - "y" : 0.02253700792789459 + "x" : 0.0002643987536430359, + "y" : 0.002074912190437317 }, - "massData-mass" : 0.2077923268079758, + "massData-mass" : 0.2077923566102982, "name" : "chest", "position" : { - "x" : -0.02137973159551620, - "y" : 0.7773683071136475 + "x" : 0.0007875636219978333, + "y" : 0.7995355725288391 }, "type" : 2 }, @@ -216,35 +216,35 @@ { "x" : [ - 0.07039503753185272, - 0.07039503753185272, - -0.07039495557546616, - -0.07039495557546616 + 0.07039500027894974, + 0.07039500027894974, + -0.07039500027894974, + -0.07039500027894974 ], "y" : [ - -0.09294363856315613, - 0.1277718394994736, - 0.1277718394994736, - -0.09294363856315613 + -0.09294360131025314, + 0.1277720034122467, + 0.1277720034122467, + -0.09294360131025314 ] } } } ], "linearVelocity" : 0, - "massData-I" : 0.0001869033440016210, + "massData-I" : 0.0001869037223514169, "massData-center" : { - "x" : 4.097818973036738e-08, - "y" : 0.01741409860551357 + "x" : 0, + "y" : 0.01741420105099678 }, - "massData-mass" : 0.03107452951371670, + "massData-mass" : 0.03107454814016819, "name" : "lowerLeftLeg", "position" : { - "x" : -0.04570891708135605, - "y" : 0.09799571335315704 + "x" : -0.03829947486519814, + "y" : 0.09799569845199585 }, "type" : 2 }, @@ -320,33 +320,33 @@ [ 0.04693000018596649, 0.04693000018596649, - -0.04693005979061127, - -0.04693005979061127 + -0.04693010076880455, + -0.04693010076880455 ], "y" : [ - -0.1895973682403564, - 0.1895966529846191, - 0.1895966529846191, - -0.1895973682403564 + -0.1895969957113266, + 0.1895969957113266, + 0.1895969957113266, + -0.1895969957113266 ] } } } ], "linearVelocity" : 0, - "massData-I" : 0.0004525946278590709, + "massData-I" : 0.0004525947733782232, "massData-center" : { - "x" : -2.980232238769531e-08, - "y" : -3.576278686523438e-07 + "x" : -5.029141902923584e-08, + "y" : 0 }, - "massData-mass" : 0.03559117391705513, + "massData-mass" : 0.03559118881821632, "name" : "upperRightArm", "position" : { - "x" : 0.1183081120252609, - "y" : 0.9012566804885864 + "x" : 0.1183080002665520, + "y" : 0.9012569785118103 }, "type" : 2 }, @@ -396,8 +396,8 @@ "name" : "upperRightLeg", "position" : { - "x" : 0.04785731062293053, - "y" : 0.3325108885765076 + "x" : 0.03859551250934601, + "y" : 0.3325110077857971 }, "type" : 2 }, @@ -447,8 +447,8 @@ "name" : "upperLeftLeg", "position" : { - "x" : -0.04570891708135605, - "y" : 0.3325108885765076 + "x" : -0.03829947486519814, + "y" : 0.3325110077857971 }, "type" : 2 }, @@ -471,16 +471,16 @@ { "x" : [ - 0.07039496302604675, - 0.07039496302604675, - -0.07039486616849899, - -0.07039486616849899 + 0.07039500027894974, + 0.07039500027894974, + -0.07039490342140198, + -0.07039490342140198 ], "y" : [ -0.09294389933347702, - 0.1276105940341949, - 0.1276105940341949, + 0.1276109963655472, + 0.1276109963655472, -0.09294389933347702 ] } @@ -488,18 +488,18 @@ } ], "linearVelocity" : 0, - "massData-I" : 0.0001864957448560745, + "massData-I" : 0.0001864968799054623, "massData-center" : { "x" : 4.842877032729120e-08, - "y" : 0.01733334921300411 + "y" : 0.01733354665338993 }, - "massData-mass" : 0.03105182945728302, + "massData-mass" : 0.03105190023779869, "name" : "lowerRightLeg", "position" : { - "x" : 0.04785731062293053, - "y" : 0.09799571335315704 + "x" : 0.03859551250934601, + "y" : 0.09799569845199585 }, "type" : 2 } @@ -554,33 +554,183 @@ { "anchorA" : { - "x" : 0.02210754156112671, - "y" : 0.4607425928115845 + "x" : 0.0003538504242897034, + "y" : 0.07107692956924438 }, "anchorB" : { - "x" : -0.02544101513922215, - "y" : -0.2591779232025146 + "x" : 0.0003536641597747803, + "y" : -0.1459649801254272 }, - "bodyA" : 1, - "bodyB" : 2, + "bodyA" : 3, + "bodyB" : 6, "enableLimit" : true, "enableMotor" : false, "jointSpeed" : 0, - "lowerLimit" : -0.6981316804885864, - "maxMotorTorque" : 0, + "lowerLimit" : 0.01745329238474369, + "maxMotorTorque" : 1, "motorSpeed" : 0, - "name" : "joint9", + "name" : "joint1", "refAngle" : 0, "type" : "revolute", - "upperLimit" : 1.221730470657349 + "upperLimit" : 1.919862151145935 + }, + + { + "anchorA" : + { + "x" : -0.0007802955806255341, + "y" : -0.1484909951686859 + }, + "anchorB" : + { + "x" : -0.0007801018655300140, + "y" : 0.08614099025726318 + }, + "bodyA" : 8, + "bodyB" : 4, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0.01745329238474369, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint7", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 2.443460941314697 + }, + + { + "anchorA" : + { + "x" : -0.004979588091373444, + "y" : -0.1506859958171844 + }, + "anchorB" : + { + "x" : -0.005973689258098602, + "y" : 0.08482310175895691 + }, + "bodyA" : 7, + "bodyB" : 9, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : 0.01745329238474369, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint8", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 2.443460941314697 + }, + + { + "anchorA" : + { + "x" : -0.06799955666065216, + "y" : -0.3021813035011292 + }, + "anchorB" : + { + "x" : -0.02891255542635918, + "y" : 0.1648437976837158 + }, + "bodyA" : 1, + "bodyB" : 8, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.7853981852531433, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint6", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.570796370506287 + }, + + { + "anchorA" : + { + "x" : 0.06260262429714203, + "y" : -0.3029872477054596 + }, + "anchorB" : + { + "x" : 0.02294230461120605, + "y" : 0.1640380322933197 + }, + "bodyA" : 1, + "bodyB" : 7, + "enableLimit" : true, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -0.7853981852531433, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint5", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 1.570796370506287 + }, + + { + "anchorA" : + { + "x" : 0.1179294362664223, + "y" : 0.2464744448661804 + }, + "anchorB" : + { + "x" : 0.0004089996218681335, + "y" : 0.1447530388832092 + }, + "bodyA" : 1, + "bodyB" : 6, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint2", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 + }, + + { + "anchorA" : + { + "x" : -0.1188285648822784, + "y" : 0.2521644234657288 + }, + "anchorB" : + { + "x" : -0.001505002379417419, + "y" : 0.1504430174827576 + }, + "bodyA" : 1, + "bodyB" : 0, + "enableLimit" : false, + "enableMotor" : false, + "jointSpeed" : 0, + "lowerLimit" : -2.268928050994873, + "maxMotorTorque" : 1, + "motorSpeed" : 0, + "name" : "joint3", + "refAngle" : 0, + "type" : "revolute", + "upperLimit" : 3.141592741012573 }, { "anchorA" : { "x" : 0.0008554458618164062, - "y" : -0.1461489200592041 + "y" : -0.1461489796638489 }, "anchorB" : { @@ -604,176 +754,26 @@ { "anchorA" : { - "x" : -0.09517394006252289, - "y" : 0.2718780040740967 + "x" : 0.02210754156112671, + "y" : 0.4607425332069397 }, "anchorB" : { - "x" : -1.741945743560791e-05, - "y" : 0.1479903459548950 + "x" : -0.02544101513922215, + "y" : -0.2591779232025146 }, "bodyA" : 1, - "bodyB" : 0, - "enableLimit" : false, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint3", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 3.141592741012573 - }, - - { - "anchorA" : - { - "x" : 0.1116365119814873, - "y" : -0.2944114208221436 - }, - "anchorB" : - { - "x" : 0.04127830639481544, - "y" : 0.1504460573196411 - }, - "bodyA" : 1, - "bodyB" : 7, + "bodyB" : 2, "enableLimit" : true, "enableMotor" : false, "jointSpeed" : 0, - "lowerLimit" : -0.7853981852531433, - "maxMotorTorque" : 1, + "lowerLimit" : -0.6981316804885864, + "maxMotorTorque" : 0, "motorSpeed" : 0, - "name" : "joint5", + "name" : "joint9", "refAngle" : 0, "type" : "revolute", - "upperLimit" : 1.570796370506287 - }, - - { - "anchorA" : - { - "x" : -0.06799929589033127, - "y" : -0.2890855073928833 - }, - "anchorB" : - { - "x" : -0.04493143409490585, - "y" : 0.1559127867221832 - }, - "bodyA" : 1, - "bodyB" : 8, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -0.7853981852531433, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint6", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 1.570796370506287 - }, - - { - "anchorA" : - { - "x" : 0.1396137326955795, - "y" : 0.2701327800750732 - }, - "anchorB" : - { - "x" : -7.455050945281982e-05, - "y" : 0.1462446451187134 - }, - "bodyA" : 1, - "bodyB" : 6, - "enableLimit" : false, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -2.268928050994873, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint2", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 3.141592741012573 - }, - - { - "anchorA" : - { - "x" : 0.0003538504242897034, - "y" : 0.07107692956924438 - }, - "anchorB" : - { - "x" : 0.0003536641597747803, - "y" : -0.1459646224975586 - }, - "bodyA" : 3, - "bodyB" : 6, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : -1.919862151145935, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint1", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 0 - }, - - { - "anchorA" : - { - "x" : 0.001979876309633255, - "y" : -0.1506856828927994 - }, - "anchorB" : - { - "x" : 0.001979988068342209, - "y" : 0.08382888138294220 - }, - "bodyA" : 7, - "bodyB" : 9, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : 0.01745329238474369, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint8", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 2.268928050994873 - }, - - { - "anchorA" : - { - "x" : -0.0007802955806255341, - "y" : -0.1484908312559128 - }, - "anchorB" : - { - "x" : -0.0007801018655300140, - "y" : 0.08614097535610199 - }, - "bodyA" : 8, - "bodyB" : 4, - "enableLimit" : true, - "enableMotor" : false, - "jointSpeed" : 0, - "lowerLimit" : 0.01745329238474369, - "maxMotorTorque" : 1, - "motorSpeed" : 0, - "name" : "joint7", - "refAngle" : 0, - "type" : "revolute", - "upperLimit" : 2.268928050994873 + "upperLimit" : 1.221730470657349 } ], "positionIterations" : 3, diff --git a/app/Game/Client/GameObjects/Items/RubeDoll.js b/app/Game/Client/GameObjects/Items/RubeDoll.js index 4075560..659cd08 100644 --- a/app/Game/Client/GameObjects/Items/RubeDoll.js +++ b/app/Game/Client/GameObjects/Items/RubeDoll.js @@ -37,21 +37,21 @@ function (Parent, Layer, Settings, Nc) { }; limbOptions.upperRightLeg = { - width: 4, - height: 9, + width: 5, + height: 8, x: 2, y: limbOptions.chest.height / 2 }; limbOptions.lowerLeftLeg = { - width: 4, + width: 5, height: 4, x: -2, y: limbOptions.chest.height / 2 + limbOptions.upperLeftLeg.height }; limbOptions.lowerRightLeg = { - width: 4, + width: 5, height: 4, x: 2, y: limbOptions.chest.height / 2 + limbOptions.upperRightLeg.height @@ -60,28 +60,28 @@ function (Parent, Layer, Settings, Nc) { limbOptions.upperLeftArm = { - width: 2, + width: 4, height: 8, x: -2, y: -limbOptions.chest.height / 2 }; limbOptions.upperRightArm = { - width: 3, + width: 4, height: 8, x: 2, y: -limbOptions.chest.height / 2 }; limbOptions.lowerLeftArm = { - width: 2, + width: 4, height: 5, x: -2, y: -limbOptions.chest.height / 2 + limbOptions.upperLeftArm.height }; limbOptions.lowerRightArm = { - width: 2, + width: 4, height: 5, x: 2, y: -limbOptions.chest.height / 2 + limbOptions.upperRightArm.height @@ -93,7 +93,9 @@ function (Parent, Layer, Settings, Nc) { this.limbMeshes = {}; this.baseMeshName = "chest"; this.characterName = "Chuck"; - this.lastFlipDirection = 1; + this.lastFlipDirection = -options.direction || 1; + + console.log(this.lastFlipDirection); Parent.call(this, physicsEngine, uid, options); } @@ -187,22 +189,10 @@ function (Parent, Layer, Settings, Nc) { RubeDoll.prototype.flip = function(direction) { Parent.prototype.flip.call(this, direction); - if(this.limbs) { - for(var name in this.limbMeshes) { - if(this.limbs[name]) { - Nc.trigger(Nc.ns.client.view.mesh.update, - this.layerId, - this.limbMeshes[name], - { - xScale: direction, - } - ); - } - } - } + console.log("last", this.lastFlipDirection, "now", direction); // flipping depth of right body side arm/leg images with left - if (this.lastFlipDirection != direction) { + if (this.lastFlipDirection != direction) { // FIXME : this is a bit broken. this.lastFlipDirection = direction; @@ -226,6 +216,28 @@ function (Parent, Layer, Settings, Nc) { this.limbMeshes["upperRightArm"], this.limbMeshes["upperLeftArm"] ); + + // swap short images + Nc.trigger(Nc.ns.client.view.mesh.swapMeshes, + this.layerId, + this.limbMeshes["upperRightLeg"], + this.limbMeshes["upperLeftLeg"] + ); + } + + // x flipping has to happen after (see swapMeshes) + if(this.limbs) { + for(var name in this.limbMeshes) { + if(this.limbs[name]) { + Nc.trigger(Nc.ns.client.view.mesh.update, + this.layerId, + this.limbMeshes[name], + { + xScale: direction, + } + ); + } + } } }; diff --git a/app/Game/Core/GameObjects/Items/RubeDoll.js b/app/Game/Core/GameObjects/Items/RubeDoll.js index eeca209..f30d53b 100644 --- a/app/Game/Core/GameObjects/Items/RubeDoll.js +++ b/app/Game/Core/GameObjects/Items/RubeDoll.js @@ -33,7 +33,7 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { this.body.SetUserData(this); - this.flip(options.direction); + this.flip(options.direction || 1); } RubeDoll.prototype = Object.create(Parent.prototype); @@ -41,6 +41,8 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { RubeDoll.prototype.loadRubeDollFromScene = function(options) { var scene = this.rubeLoader.getScene(); + + for (var i in scene.bodies) { var body = scene.bodies[i]; var position = body.GetPosition().Copy(); @@ -50,6 +52,15 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { )); body.SetPosition(position); this.limbs[body.name] = body; + + // code snipped possibly needed for filtering between doll and rubedoll while holding + //var filterData = new Box2D.Dynamics.b2FilterData(); + //filterData.groupIndex = -66; + //if(body.name != "head" && body.name != "chest") { + // for (var fixture = body.GetFixtureList(); fixture; fixture = fixture.GetNext()) { + // fixture.SetFilterData(filterData); + // } + //} } this.joints = scene.joints; diff --git a/static/img/Characters/Chuck/lowerLeftArm.png b/static/img/Characters/Chuck/lowerLeftArm.png index fb43dd59175fcfebcd3dca2291122613ea36c273..85d7ac4412b399d8ecc004c79dc24fabfb2fbe2b 100755 GIT binary patch literal 2776 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 diff --git a/static/img/Characters/Chuck/lowerLeftLeg.png b/static/img/Characters/Chuck/lowerLeftLeg.png index 2314dec36b6188ab3cc3d75b3d971e0b9bbcd8b7..c7b08033680a286a9cc3d8bdc36a516a2a2f5eca 100755 GIT binary patch literal 2785 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 diff --git a/static/img/Characters/Chuck/lowerRightLeg.png b/static/img/Characters/Chuck/lowerRightLeg.png index 2314dec36b6188ab3cc3d75b3d971e0b9bbcd8b7..1d7c7b84646468e4d950126e23a3ba47ade1317e 100755 GIT binary patch literal 2785 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 v000$9L_t&t*JEHdU|52 literal 145 zcmeAS@N?(olHy`uVBq!ia0vp^OhC-R!3-pye7;uzq$EpRBT9nv(@M${i&7aJQ}UBi z6+Ckj(^G>|6H_V+Po~-c74Zl7gt(rW9lfn5B)ZrqIMdZH+39lb$Gbo&2~QWtkcwML p2}wx_X-Nr*X$dI~ZVZfU42%T~VlyIFr2^G3c)I$ztaD0e0suQdDv|&I diff --git a/static/img/Characters/Chuck/upperRightArm.png b/static/img/Characters/Chuck/upperRightArm.png index 44bf6cf377ca6cbfbff29fc6266ae4dacaf2203e..cd31fce6edd8b1a0593d41d21a1641a5df94f97a 100755 GIT binary patch literal 2793 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 v000$9L_t&t*JEHdU|RF{JKv}kuAirQB z_y2!}&HI<^2a3pex;TbZ+)7GFN=i*gN=!>gOiN2hNO3*Rz{tkH!opzfwtcTFP#uG( LtDnm{r-UW|_~$iM diff --git a/static/img/Characters/Chuck/upperRightLeg.png b/static/img/Characters/Chuck/upperRightLeg.png index 11b5f29c66ae3bf70477490c169d71d5140a1595..c8ab6d672e92ce12394be286afaf522729a5738d 100644 GIT binary patch delta 2805 zcmV;QlP9${Ff#{e35u39)87vVOh&UxnkS?~*ikKRgEM^!bX1*vv5zC1=VUZ0!`z*4f znAxd3wur?!r?XSpV(u03woD;M#E7qm3p2T#ED_%lu||q8l`G;m;@DIUGXnq=e@Sc? za9D{VHW4w29}?su;^hF~NC{tY+*d5%WDCTXa!E_i;d2ub1#}&jF5T4HnnCyEWTkKf z0>c0%E1Ah>(_PY1)0w;+02c53Su*0<(nUqKG_|(0G&D0Z{i;y^b@OjZ+}lNZ8Th$p z5Uu}YB~8euXQVS(9J=A3hxi`{ z{&gM(L7aFFpTiSHgo&n%%S#Zoo5$t~xM@5(m-nBV_z%PWq{X=wiPHEHe^6tLfYfy= zKz{89C<+lE(fh?+|D$id_%I-TdEqLPi*x_)H~nY9rQ#)noA5c#B`Ac>67n+__r%W< zpaB6$0xFOP%0M0H07GB~tbi?W1a80^_=6A-304CZNCc^X53)cW*aQkeG1v+AfND?& z8bLE?1;;@rI0epwOW+!~e*tcT`(PAIfM;M9yao#p1YsdEM1kZX6-X1(hs+=bWDmJP zzEBVp3B^JQ5DyYUdC+F47%GFRp?atp`W`w7orkVKgV0@Q44Q_1hu*;mOoFMf608Lq z!wlF7_JKp-Rd52l2F`^G;2m%!+yEbiJK*#1HTX6>3O|GA5P%R7e;T5S7$OYB1@T9s zka&cTtVfEF3ZwyPMY@qbwx1%qjZ=)yBuQ3=54Wo^*!gyjLF-e%U zm=erBOdIALW)L%uf0@H#vGQ1btR2=L%ft$>h1e?WQS4dl5OxCl21mrH;LLFDxF{SC zmyfH!9l@Q!4dEtn3wSBKCf)|`k7wg^@TK@hd^i3&egeNhkS1so>_C83pY zk??@5*JW(Ig>he+TIh=^W`U=_Q#=)*?HS zqsRjC4stX30{Id7jRZx)NWx2kEwMqOMxsMvNaDF9UQ$!iNpiJhu4IMe3CZh{Gg5dd zEh!f%rqp_=8mW^~BT{qH6lqgwf9X`|66qt-SEQ$8urgXQZZd3{0-1v{7i7jM2t}RZ zLSa!hQyM83e<>4G3{{)zMNOg>Q@^7QP-kUjWS7Z?$!5#e$exxRr6DveninmFR!Tcg z8>YQmqO`QdXKtffUuk1xHa2rKF-1}UypJgC^Oe>kV4tmL7Tu2iLTL1{*rrtGMk zq+G6iMtNF=qGGSYRVi0FtMZgCOLwBD&@1V^^jTF!RZmr+YQ5@!>VlfKTBusSTASKK zb%HuWJzl+By+?gkLq)?+BTu76*gyjC_sqjXI5<8*3Ox8SgUgGyZ5|VUl9fXma0F#?;$1-?ZEGcQZXR zmRXJ2EpxKDyZHw5F7p@5^p|m#?O%4sf@0xkf3ek~$Kr#fl_lS@)pFWO!z$LQ)@p=7 zWdtxv7?-Wl*3Q-&tWR0LwXw7j*c`X{&DPL1+4hL-)N<|RoaK$n$L-YYn0EDcqxN+B zSo;I^qYkPLOos-C$BycbY{w?YNhe*WB&VZJ&z()2`OfXm^DZ_n>s-#cBCZ~;MXm#G ze==^NZq;s&+|}F@+*{mdJuE!ddYtn_d-{0p@*MF}@?v>4d(C=Vd9U;C^&$BL`&9cp z_SN&{`*!=me%^k&{T{5)T)|t>=@0z9{CE354A2f(6YygoCNLndCh$p+X;5BJUoa&& zCiqD3>k#LV(vbV1I-$bQo-oO<=&{&C*_u)5XKpCqtx&&0w&s4uq zN4P~emT8|^lldkqEbBzJbT%)$KSwWTd(LF8d+xVuQEORid-7ECHsy`2b6Quw9$Fu_ zzGs8_hJpTWf0O*O{8yX9H+L5(6>KaR-{P^QrBI@fUpTVWc5B@> z)Hd$6f$iqotG0hEVi#R4HYu(seqX{Wx%!RiHe#iZ-bxL)`b?**v58SEusPAadYN$AfIhc9yNn==J-?xl!o0}Axikm(h z;vE`29CWz1*{Zquh~kmb7Pv*&GJQ1q=#B4Ozw2r>Y^`sjwG|%&$Arh8ejoe&@Nu8x zJtr6^T7S^|p|+jUUep0~f8=z`b|!X?c13m#p7cK1({0<`{-e>4hfb-UsyQuty7Ua; zOu?B?XLHZaol8GAb3Wnxcu!2v{R_`T4=x`(GvqLI{-*2Ae@nN#Ze6>*;`ZQh z=^oC;Q|`XFmw9jD{>BIB2SpF19#%Y3eAMu>?$2$bmZPV~T*vw!2S2_) z&KiIAOU5tnCkmdBpHxh$Og2xMO`V!{pT6;Q<CYBs3V)UUwf4Er^B;b5{H=dB zVs_#M|HY@@OJ2&qOg!{z*{hzpfVoGnQ(rI47rl{xbNDUeZQr}_casZQ@3HSIKj?nw z{^;}Z!Kc(upZ)~{nDhL)#OTui000JJOGiWi{{a60|De66laV18cK`=;Nliru-vtH_ zDgsCjKFBY5 literal 2866 zcmV-23(fS2P)p8800009a7bBm000XU z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z00018Nklg9m6aWAK diff --git a/static/items/rube/ragdoll.rube b/static/items/rube/ragdoll.rube index 7024172..bbe7d2d 100644 --- a/static/items/rube/ragdoll.rube +++ b/static/items/rube/ragdoll.rube @@ -84,16 +84,16 @@ { "x" : [ - 0.07039496302604675, - 0.07039496302604675, - -0.07039486616849899, - -0.07039486616849899 + 0.07039500027894974, + 0.07039500027894974, + -0.07039490342140198, + -0.07039490342140198 ], "y" : [ -0.09294389933347702, - 0.1276105940341949, - 0.1276105940341949, + 0.1276109963655472, + 0.1276109963655472, -0.09294389933347702 ] } @@ -101,18 +101,18 @@ ], "id" : 1, "linearVelocity" : 0, - "massData-I" : 0.0001864957448560745, + "massData-I" : 0.0001864968799054623, "massData-center" : { "x" : 4.842877032729120e-08, - "y" : 0.01733334921300411 + "y" : 0.01733354665338993 }, - "massData-mass" : 0.03105182945728302, + "massData-mass" : 0.03105190023779869, "name" : "lowerRightLeg", "position" : { - "x" : 0.04785731062293053, - "y" : 0.09799571335315704 + "x" : 0.03859551250934601, + "y" : 0.09799569845199585 }, "type" : "dynamic" }, @@ -168,8 +168,8 @@ "name" : "upperLeftLeg", "position" : { - "x" : -0.04570891708135605, - "y" : 0.3325108885765076 + "x" : -0.03829947486519814, + "y" : 0.3325110077857971 }, "type" : "dynamic" }, @@ -225,8 +225,8 @@ "name" : "upperRightLeg", "position" : { - "x" : 0.04785731062293053, - "y" : 0.3325108885765076 + "x" : 0.03859551250934601, + "y" : 0.3325110077857971 }, "type" : "dynamic" }, @@ -257,33 +257,33 @@ [ 0.04693000018596649, 0.04693000018596649, - -0.04693005979061127, - -0.04693005979061127 + -0.04693010076880455, + -0.04693010076880455 ], "y" : [ - -0.1895973682403564, - 0.1895966529846191, - 0.1895966529846191, - -0.1895973682403564 + -0.1895969957113266, + 0.1895969957113266, + 0.1895969957113266, + -0.1895969957113266 ] } } ], "id" : 4, "linearVelocity" : 0, - "massData-I" : 0.0004525946278590709, + "massData-I" : 0.0004525947733782232, "massData-center" : { - "x" : -2.980232238769531e-08, - "y" : -3.576278686523438e-07 + "x" : -5.029141902923584e-08, + "y" : 0 }, - "massData-mass" : 0.03559117391705513, + "massData-mass" : 0.03559118881821632, "name" : "upperRightArm", "position" : { - "x" : 0.1183081120252609, - "y" : 0.9012566804885864 + "x" : 0.1183080002665520, + "y" : 0.9012569785118103 }, "type" : "dynamic" }, @@ -369,35 +369,35 @@ { "x" : [ - 0.07039503753185272, - 0.07039503753185272, - -0.07039495557546616, - -0.07039495557546616 + 0.07039500027894974, + 0.07039500027894974, + -0.07039500027894974, + -0.07039500027894974 ], "y" : [ - -0.09294363856315613, - 0.1277718394994736, - 0.1277718394994736, - -0.09294363856315613 + -0.09294360131025314, + 0.1277720034122467, + 0.1277720034122467, + -0.09294360131025314 ] } } ], "id" : 6, "linearVelocity" : 0, - "massData-I" : 0.0001869033440016210, + "massData-I" : 0.0001869037223514169, "massData-center" : { - "x" : 4.097818973036738e-08, - "y" : 0.01741409860551357 + "x" : 0, + "y" : 0.01741420105099678 }, - "massData-mass" : 0.03107452951371670, + "massData-mass" : 0.03107454814016819, "name" : "lowerLeftLeg", "position" : { - "x" : -0.04570891708135605, - "y" : 0.09799571335315704 + "x" : -0.03829947486519814, + "y" : 0.09799569845199585 }, "type" : "dynamic" }, @@ -529,35 +529,35 @@ { "x" : [ - -0.1156369969248772, - 0.1570899933576584, - 0.1570899933576584, - -0.1156369969248772 + -0.1360991001129150, + 0.1366278976202011, + 0.1366278976202011, + -0.1360991001129150 ], "y" : [ - -0.3584159910678864, - -0.3584159910678864, - 0.4034900069236755, - 0.4034900069236755 + -0.3788780868053436, + -0.3788780868053436, + 0.3830279111862183, + 0.3830279111862183 ] } } ], "id" : 9, "linearVelocity" : 0, - "massData-I" : 0.01153474114835262, + "massData-I" : 0.01134084537625313, "massData-center" : { - "x" : 0.02072649449110031, - "y" : 0.02253700792789459 + "x" : 0.0002643987536430359, + "y" : 0.002074912190437317 }, - "massData-mass" : 0.2077923268079758, + "massData-mass" : 0.2077923566102982, "name" : "chest", "position" : { - "x" : -0.02137973159551620, - "y" : 0.7773683071136475 + "x" : 0.0007875636219978333, + "y" : 0.7995355725288391 }, "type" : "dynamic" }, @@ -586,17 +586,17 @@ { "x" : [ - 0.04692991077899933, - 0.04692991077899933, - -0.04692997038364410, - -0.04692997038364410 + 0.04692989960312843, + 0.04692989960312843, + -0.04693000018596649, + -0.04693000018596649 ], "y" : [ - -0.1895973682403564, - 0.1895966529846191, - 0.1895966529846191, - -0.1895973682403564 + -0.1895969957113266, + 0.1895969957113266, + 0.1895969957113266, + -0.1895969957113266 ] } } @@ -606,15 +606,15 @@ "massData-I" : 0.0004525936674326658, "massData-center" : { - "x" : -2.980232238769531e-08, - "y" : -3.576278686523438e-07 + "x" : -5.029141902923584e-08, + "y" : 0 }, "massData-mass" : 0.03559110686182976, "name" : "upperLeftArm", "position" : { - "x" : -0.1165364086627960, - "y" : 0.9012566804885864 + "x" : -0.1165359988808632, + "y" : 0.9012569785118103 }, "type" : "dynamic" } @@ -625,13 +625,13 @@ { "anchorA" : { - "x" : -0.0007802955806255341, - "y" : -0.1484908312559128 + "x" : -0.0007802959880791605, + "y" : -0.1484909951686859 }, "anchorB" : { - "x" : -0.0007801018655300140, - "y" : 0.08614096790552139 + "x" : -0.0007801019819453359, + "y" : 0.08614099770784378 }, "bodyA" : 2, "bodyB" : 6, @@ -645,19 +645,19 @@ "name" : "joint7", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 2.268928050994873 + "upperLimit" : 2.443460941314697 }, { "anchorA" : { - "x" : 0.001979876309633255, - "y" : -0.1506856828927994 + "x" : -0.004979589954018593, + "y" : -0.1506859958171844 }, "anchorB" : { - "x" : 0.001979988068342209, - "y" : 0.08382887393236160 + "x" : -0.005973690189421177, + "y" : 0.08482310175895691 }, "bodyA" : 3, "bodyB" : 1, @@ -671,7 +671,7 @@ "name" : "joint8", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 2.268928050994873 + "upperLimit" : 2.443460941314697 }, { @@ -682,8 +682,8 @@ }, "anchorB" : { - "x" : 0.0003536641597747803, - "y" : -0.1459646224975586 + "x" : 0.0003536640142556280, + "y" : -0.1459649950265884 }, "bodyA" : 7, "bodyB" : 4, @@ -691,25 +691,25 @@ "enableLimit" : true, "enableMotor" : false, "id" : 3, - "lowerLimit" : -1.919862151145935, + "lowerLimit" : 0.01745329238474369, "maxMotorTorque" : 1, "motorSpeed" : 0, "name" : "joint1", "referenceAngle" : 0, "type" : "revolute", - "upperLimit" : 0 + "upperLimit" : 1.919862151145935 }, { "anchorA" : { - "x" : 0.1396137326955795, - "y" : 0.2701327204704285 + "x" : 0.1179294362664223, + "y" : 0.2464744448661804 }, "anchorB" : { - "x" : -7.455050945281982e-05, - "y" : 0.1462445855140686 + "x" : 0.0004089996218681335, + "y" : 0.1447530388832092 }, "bodyA" : 9, "bodyB" : 4, @@ -729,13 +729,13 @@ { "anchorA" : { - "x" : -0.06799929589033127, - "y" : -0.2890855073928833 + "x" : -0.06799955666065216, + "y" : -0.3021813035011292 }, "anchorB" : { - "x" : -0.04493143782019615, - "y" : 0.1559127867221832 + "x" : -0.02891255542635918, + "y" : 0.1648437976837158 }, "bodyA" : 9, "bodyB" : 2, @@ -755,13 +755,13 @@ { "anchorA" : { - "x" : 0.1116365119814873, - "y" : -0.2944114208221436 + "x" : 0.06260262429714203, + "y" : -0.3029872477054596 }, "anchorB" : { - "x" : 0.04127831012010574, - "y" : 0.1504460573196411 + "x" : 0.02294230461120605, + "y" : 0.1640380322933197 }, "bodyA" : 9, "bodyB" : 3, @@ -781,13 +781,13 @@ { "anchorA" : { - "x" : -0.09517394006252289, - "y" : 0.2718779444694519 + "x" : -0.1188285648822784, + "y" : 0.2521644234657288 }, "anchorB" : { - "x" : -1.741945743560791e-05, - "y" : 0.1479902863502502 + "x" : -0.001505002379417419, + "y" : 0.1504430174827576 }, "bodyA" : 9, "bodyB" : 10, @@ -807,8 +807,8 @@ { "anchorA" : { - "x" : 0.0008554458618164062, - "y" : -0.1461489200592041 + "x" : 0.0008554459782317281, + "y" : -0.1461489945650101 }, "anchorB" : { From 07dad646cfde9ed9ce9cf2af66c56877ce8af14a Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 22 Jun 2015 00:14:17 +0200 Subject: [PATCH 31/68] new system for synchronizing game objects. fixes #74 --- app/Game/Channel/GameController.js | 44 ++++--- app/Game/Channel/GameObjects/Doll.js | 12 ++ app/Game/Channel/GameObjects/GameObject.js | 36 +++++- app/Game/Channel/Loader/Level.js | 4 +- app/Game/Client/GameController.js | 53 +++----- app/Game/Client/GameObjects/GameObject.js | 2 +- app/Game/Client/GameObjects/Item.js | 2 + app/Game/Client/GameObjects/Items/RubeDoll.js | 2 - app/Game/Client/Loader/TiledLevel.js | 4 +- app/Game/Client/Player.js | 2 + app/Game/Core/GameController.js | 122 ++++++------------ app/Game/Core/GameObjects/Doll.js | 10 ++ app/Game/Core/GameObjects/GameObject.js | 27 +++- app/Game/Core/GameObjects/Item.js | 4 +- app/Game/Core/GameObjects/Items/RagDoll.js | 1 - app/Game/Core/GameObjects/Items/RubeDoll.js | 1 - app/Game/Core/GameObjects/Tile.js | 6 - app/Game/Core/Player.js | 8 +- app/Lib/Utilities/NotificationCenter.js | 16 ++- 19 files changed, 194 insertions(+), 162 deletions(-) diff --git a/app/Game/Channel/GameController.js b/app/Game/Channel/GameController.js index 6b3b1db..001537f 100755 --- a/app/Game/Channel/GameController.js +++ b/app/Game/Channel/GameController.js @@ -83,8 +83,6 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N var spawnTimeout = setTimeout(function() { player.spawn(spawnPoint.x, spawnPoint.y); - // put it into - self.gameObjects.animated.push(player); var options = { id: player.id, @@ -118,6 +116,7 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N var update = {}; +/* var body = this.physicsEngine.world.GetBodyList(); do { if((getSleeping || body.IsAwake()) && body.GetType() === Box2D.Dynamics.b2Body.b2_dynamicBody) { @@ -125,22 +124,33 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N if (userData instanceof GameObject) { var gameObject = userData; - - update[gameObject.uid] = { - p: body.GetPosition(), - a: body.GetAngle(), - lv: body.GetLinearVelocity(), - av: body.GetAngularVelocity() - }; - - if(gameObject instanceof Doll) { - update[gameObject.uid].as = gameObject.getActionState(); - update[gameObject.uid].laxy = gameObject.lookAtXY; + var updateData = gameObject.getUpdateData(); + + if (updateData) { + update[gameObject.uid] = updateData; } } } } while (body = body.GetNext()); +*/ + + for (var uid in this.worldUpdateObjects) { + + var gameObject = this.worldUpdateObjects[uid]; + + if (!(gameObject instanceof GameObject)) { + console.warn('Cant find object ' + uid + ' in worldUpdateObjects pool (channel side), here is the object:'); + console.log(gameObject); + continue; + } + + var updateData = gameObject.getUpdateData(getSleeping); + + if (updateData) { + update[gameObject.uid] = updateData; + } + } return update; }; @@ -171,9 +181,11 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N GameController.prototype.getRuntimeItems = function() { var objects = []; - for (var i = 0; i < this.gameObjects.animated.length; i++) { - if(this.gameObjects.animated[i] instanceof RubeDoll) { - var object = this.gameObjects.animated[i]; + // This is using the level.createItem mechanism to + // create the RubeDoll from its ItemSettings + for (var uid in this.worldUpdateObjects) { + if(this.worldUpdateObjects[uid] instanceof RubeDoll) { + var object = this.worldUpdateObjects[uid]; var options = object.options; options.x = object.getPosition().x; options.y = object.getPosition().y; diff --git a/app/Game/Channel/GameObjects/Doll.js b/app/Game/Channel/GameObjects/Doll.js index 1b93440..9d109a4 100755 --- a/app/Game/Channel/GameObjects/Doll.js +++ b/app/Game/Channel/GameObjects/Doll.js @@ -98,6 +98,18 @@ function (Parent, Item, Box2D, Nc, Assert) { this.body.SetLinearVelocity(update.lv); } }; + + Doll.prototype.getUpdateData = function(getSleeping) { + + var updateData = Parent.prototype.getUpdateData.call(this, getSleeping); + + if(updateData) { + updateData.as = this.getActionState(); + updateData.laxy = this.lookAtXY; + } + + return updateData; + }; return Doll; diff --git a/app/Game/Channel/GameObjects/GameObject.js b/app/Game/Channel/GameObjects/GameObject.js index 03b2a9b..5d51afb 100755 --- a/app/Game/Channel/GameObjects/GameObject.js +++ b/app/Game/Channel/GameObjects/GameObject.js @@ -1,9 +1,39 @@ define([ - "Game/Core/GameObjects/GameObject" + "Game/Core/GameObjects/GameObject", + "Lib/Vendor/Box2D" ], -function(Parent) { +function (Parent, Box2D) { - return Parent; + "use strict"; + function GameObject(physicsEngine, uid) { + Parent.call(this, physicsEngine, uid); + } + + GameObject.prototype = Object.create(Parent.prototype); + + GameObject.prototype.getUpdateData = function(getSleeping) { + + if (!this.body) { + return null; + } + + if (this.body.GetType() === Box2D.Dynamics.b2Body.b2_staticBody) { + return null; + } + + if (!getSleeping && !this.body.IsAwake()) { + return null; + } + + return { + p: this.body.GetPosition(), + a: this.body.GetAngle(), + lv: this.body.GetLinearVelocity(), + av: this.body.GetAngularVelocity() + }; + } + + return GameObject; }); \ No newline at end of file diff --git a/app/Game/Channel/Loader/Level.js b/app/Game/Channel/Loader/Level.js index 855fea3..4271cd3 100755 --- a/app/Game/Channel/Loader/Level.js +++ b/app/Game/Channel/Loader/Level.js @@ -8,8 +8,8 @@ function (Parent, Settings, FileSystem) { "use strict"; - function Level (uid, engine, gameObjects) { - Parent.call(this, uid, engine, gameObjects); + function Level (uid, engine) { + Parent.call(this, uid, engine); } Level.prototype = Object.create(Parent.prototype); diff --git a/app/Game/Client/GameController.js b/app/Game/Client/GameController.js index 8b01659..b64ea92 100755 --- a/app/Game/Client/GameController.js +++ b/app/Game/Client/GameController.js @@ -55,9 +55,11 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque this.mePositionStateUpdate(); } - for (var i = 0; i < this.gameObjects.animated.length; i++) { - this.gameObjects.animated[i].render(); - } + //for (var uid in this.gameObjects.animated) { + // this.gameObjects.animated[uid].render(); + //} + + Nc.trigger(Nc.ns.client.game.events.render); this.view.render(); DomController.fpsStep(); @@ -78,17 +80,10 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque if (options.runtimeItems) { for (i = 0; i < options.runtimeItems.length; i++) { + var itemDef = options.runtimeItems[i]; - var alreadyExists = false; - for (var j = 0; j < this.gameObjects.animated.length; j++) { - if(this.gameObjects.animated[j].uid == itemDef.uid) { - alreadyExists = true; - break; - } - } - - if(!alreadyExists) { + if(!this.getItemByUid(itemDef.uid)) { // When creating from synchronization we need to bring it into level format (px) itemDef.options.x *= Settings.RATIO; itemDef.options.y *= Settings.RATIO; @@ -112,6 +107,13 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque //this.audioPlayer.play(); }; + + /* + + TODO : + - remove this + - overwrite setUpdateData inside client / Me with an empty function + GameController.prototype.onWorldUpdateGameObject = function(body, gameObject, update) { if(gameObject === this.me.doll) { this.me.setLastServerPositionState(update); @@ -122,6 +124,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque Parent.prototype.onWorldUpdateGameObject.call(this, body, gameObject, update); }; + */ GameController.prototype.createMe = function(user) { this.me = new Me(user.id, this.physicsEngine, user); @@ -161,15 +164,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque GameController.prototype.onHandActionResponse = function(options) { var player = this.players[options.playerId]; - - var item = null; - for (var i = 0; i < this.gameObjects.animated.length; i++) { - var currentItem = this.gameObjects.animated[i]; - if(currentItem.uid == options.itemUid) { - item = currentItem; - break; - } - } + var item = this.getItemByUid(options.itemUid); if(item) { if(options.action == "throw") { @@ -230,22 +225,6 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque this.me.resetPositionState(options); }; - GameController.prototype.onRemoveGameObject = function(options) { - var object = null; - for (var i = 0; i < this.gameObjects[options.type].length; i++) { - if(this.gameObjects[options.type][i].uid == options.uid) { - object = this.gameObjects[options.type][i]; - break; - } - } - if(object) { - //this.onGameObjectRemove(options.type, object); - object.destroy(); - } else { - console.warn("GameObject for removal can not be found locally. " + options.uid); - } - }; - GameController.prototype.loadLevel = function (path) { Parent.prototype.loadLevel.call(this, path); }; diff --git a/app/Game/Client/GameObjects/GameObject.js b/app/Game/Client/GameObjects/GameObject.js index d20405e..4067b7e 100755 --- a/app/Game/Client/GameObjects/GameObject.js +++ b/app/Game/Client/GameObjects/GameObject.js @@ -27,7 +27,7 @@ function (Parent, Exception, Nc) { GameObject.prototype.createMesh = function() { throw new Exception('Abstract method GameObject.createMesh not overwritten'); }; - + return GameObject; }); \ No newline at end of file diff --git a/app/Game/Client/GameObjects/Item.js b/app/Game/Client/GameObjects/Item.js index f49fb8a..8115858 100755 --- a/app/Game/Client/GameObjects/Item.js +++ b/app/Game/Client/GameObjects/Item.js @@ -12,6 +12,8 @@ function (Parent, Settings, Nc, Layer) { function Item(physicsEngine, uid, options) { this.layerId = Layer.ID.ITEM; Parent.call(this, physicsEngine, uid, options); + + Nc.on(Nc.ns.client.game.events.render, this.render, this); } Item.prototype = Object.create(Parent.prototype); diff --git a/app/Game/Client/GameObjects/Items/RubeDoll.js b/app/Game/Client/GameObjects/Items/RubeDoll.js index 659cd08..bed947c 100644 --- a/app/Game/Client/GameObjects/Items/RubeDoll.js +++ b/app/Game/Client/GameObjects/Items/RubeDoll.js @@ -189,8 +189,6 @@ function (Parent, Layer, Settings, Nc) { RubeDoll.prototype.flip = function(direction) { Parent.prototype.flip.call(this, direction); - console.log("last", this.lastFlipDirection, "now", direction); - // flipping depth of right body side arm/leg images with left if (this.lastFlipDirection != direction) { // FIXME : this is a bit broken. diff --git a/app/Game/Client/Loader/TiledLevel.js b/app/Game/Client/Loader/TiledLevel.js index ae1299c..5316245 100644 --- a/app/Game/Client/Loader/TiledLevel.js +++ b/app/Game/Client/Loader/TiledLevel.js @@ -8,9 +8,9 @@ function (Parent, Settings, Nc) { "use strict"; - function TiledLevel(uid, engine, gameObjects) { + function TiledLevel(uid, engine) { this.layerId = "background"; - Parent.call(this, uid, engine, gameObjects); + Parent.call(this, uid, engine); } TiledLevel.prototype = Object.create(Parent.prototype); diff --git a/app/Game/Client/Player.js b/app/Game/Client/Player.js index cb7c9db..6f511ac 100755 --- a/app/Game/Client/Player.js +++ b/app/Game/Client/Player.js @@ -15,6 +15,8 @@ function (Parent, Nc, Settings) { this.healthBarViewVisibleTimeout = null; this.healthBarViewVisible = false; this.initHealthBar(); + + Nc.on(Nc.ns.client.game.events.render, this.render, this); } Player.prototype = Object.create(Parent.prototype); diff --git a/app/Game/Core/GameController.js b/app/Game/Core/GameController.js index 4c4bf71..18b095d 100755 --- a/app/Game/Core/GameController.js +++ b/app/Game/Core/GameController.js @@ -17,15 +17,14 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Assert) { this.options = options; this.players = {}; this.level = null; - this.gameObjects = null; - this.resetGameObjects(); + this.worldUpdateObjects = {}; this.physicsEngine = new PhysicsEngine(); this.physicsEngine.setCollisionDetector(); this.ncTokens = [ - Nc.on(Nc.ns.core.game.gameObject.add, this.onGameObjectAdd, this), - Nc.on(Nc.ns.core.game.gameObject.remove, this.onGameObjectRemove, this) + Nc.on(Nc.ns.core.game.worldUpdateObjects.add, this.onWorldUpdateObjectAdd, this), + Nc.on(Nc.ns.core.game.worldUpdateObjects.remove, this.onWorldUpdateObjectRemove, this) ]; this.loadLevel(options.levelUid); @@ -37,79 +36,58 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Assert) { // extend for both sides if necessary }; - GameController.prototype.resetGameObjects = function() { - this.gameObjects = { - fixed: [], - animated: [] - }; + GameController.prototype.onWorldUpdateObjectAdd = function(object) { + this.worldUpdateObjects[object.uid] = object; }; - GameController.prototype.onGameObjectAdd = function(type, object) { - this.gameObjects[type].push(object); - }; - - GameController.prototype.onGameObjectRemove = function(type, object) { - var i = this.gameObjects[type].indexOf(object); - if(i>=0) this.gameObjects[type].splice(i, 1); + GameController.prototype.onWorldUpdateObjectRemove = function(object) { + delete this.worldUpdateObjects[object.uid]; }; GameController.prototype.getPhysicsEngine = function () { return this.physicsEngine; }; + GameController.prototype.getItemByUid = function(uid) { + // FIXME : maybe divide this into a dedicated item pool? + return this.worldUpdateObjects[uid]; + }; + GameController.prototype.loadLevel = function (levelUid) { if (this.level) { this.level.destroy(); - this.resetGameObjects(); + this.worldUpdateObjects = {}; } - this.level = new TiledLevel(levelUid, this.physicsEngine, this.gameObjects); + this.level = new TiledLevel(levelUid, this.physicsEngine); }; + /* + * This is now in core, because the recorder/player + * uses the world update mechanism on the channel side + */ GameController.prototype.onWorldUpdate = function (updateData) { - var body = this.physicsEngine.world.GetBodyList(); - do { - var userData = body.GetUserData(); - if (userData instanceof GameObject) { - var gameObject = userData; - if(updateData[gameObject.uid]) { - var update = updateData[gameObject.uid]; - this.onWorldUpdateGameObject(body, gameObject, update); - } + for (var uid in updateData) { + + var gameObject = this.worldUpdateObjects[uid]; + + if (!(gameObject instanceof GameObject)) { + console.warn('Cant find object ' + uid + ' in worldUpdateObjects pool'); + continue; } - } while (body = body.GetNext()); - - }; - - GameController.prototype.onWorldUpdateGameObject = function(body, gameObject, update) { - if (gameObject instanceof Doll) { - /* - if(gameObject === this.me.doll) { - this.me.setLastServerPositionState(update); - if(!this.me.acceptPositionStateUpdateFromServer()) { - return; // this is to ignore own doll updates from world update - } - } - */ - gameObject.setActionState(update.as); - gameObject.lookAt(update.laxy.x, update.laxy.y); + gameObject.setUpdateData(updateData[uid]); } - - Assert.number(update.p.x, update.p.y); - Assert.number(update.a); - Assert.number(update.lv.x, update.lv.y); - Assert.number(update.av); - - body.SetAwake(true); - body.SetPosition(update.p); - body.SetAngle(update.a); - body.SetLinearVelocity(update.lv); - body.SetAngularVelocity(update.av); }; +/* + GameController.prototype.onWorldUpdateGameObject = function(body, gameObject, update) { + FIXME : call gameObject.setUpdateData(updateData[uid]); + }; +*/ + GameController.prototype.onResetLevel = function() { this.loadLevel(this.level.uid); }; @@ -140,39 +118,23 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Assert) { GameController.prototype.destroy = function () { var i = 0; - /* for(var player in this.players) { - // this.players[player].destroy(); - - // FIXME: - // commented out for now, because players are in gameObjects array. - // try using a real gameobject for the health bar - }*/ - - - for (i = 0; i < this.ncTokens.length; i++) { - Nc.off(this.ncTokens[i]); + this.players[player].destroy(); } - /* - * Contents of gameObject: Players, Items, Tiles, RagDolls - * No Dolls. - */ + Nc.trigger(Nc.ns.client.game.events.destroy); - for (var key in this.gameObjects) { - for (i = 0; i < this.gameObjects[key].length; i++) { - var gameObject = this.gameObjects[key][i]; - - gameObject.destroy(); - } + // Testing after destroy if worldUpdateObjects is empty + // events.game.destroy -> gameobjects.destroy() -> Nc.trigger(worldUpdateObjects.remove) + if(Object.keys(this.worldUpdateObjects).length > 0) { + console.warn('Not all worldUpdateObjects have been removed... ', Object.keys(this.worldUpdateObjects)); } - this.gameObjects = { - fixed: [], - animated: [] - }; - this.physicsEngine.destroy(); + this.worldUpdateObjects = null; + + Nc.off(this.ncTokens); + }; return GameController; diff --git a/app/Game/Core/GameObjects/Doll.js b/app/Game/Core/GameObjects/Doll.js index 7dd7780..5c8f1c2 100755 --- a/app/Game/Core/GameObjects/Doll.js +++ b/app/Game/Core/GameObjects/Doll.js @@ -45,6 +45,7 @@ function (Parent, Exception, Box2D, Settings, CollisionDetector, Item, Nc, Asser this.createFixtures(); this.body.SetActive(false); + Nc.trigger(Nc.ns.core.game.worldUpdateObjects.add, this); } Doll.prototype = Object.create(Parent.prototype); @@ -471,7 +472,16 @@ function (Parent, Exception, Box2D, Settings, CollisionDetector, Item, Nc, Asser } }; + Doll.prototype.setUpdateData = function(update) { + + Parent.prototype.setUpdateData.call(this, update); + + this.setActionState(update.as); + this.lookAt(update.laxy.x, update.laxy.y); + }; + Doll.prototype.destroy = function() { + Nc.trigger(Nc.ns.core.game.worldUpdateObjects.remove, this); Parent.prototype.destroy.call(this); }; diff --git a/app/Game/Core/GameObjects/GameObject.js b/app/Game/Core/GameObjects/GameObject.js index d0c26bf..c0f63e3 100755 --- a/app/Game/Core/GameObjects/GameObject.js +++ b/app/Game/Core/GameObjects/GameObject.js @@ -1,9 +1,11 @@ define([ "Lib/Vendor/Box2D", - "Lib/Utilities/Exception" + "Lib/Utilities/Exception", + "Lib/Utilities/Assert", + "Lib/Utilities/NotificationCenter" ], -function (Box2D, Exception) { +function (Box2D, Exception, Assert, Nc) { "use strict"; @@ -13,6 +15,10 @@ function (Box2D, Exception) { var def = this.getBodyDef(); def.userData = this; this.body = physicsEngine.getWorld().CreateBody(def); + + this.ncTokens = (this.ncTokens || []).concat([ + Nc.on(Nc.ns.client.game.events.destroy, this.destroy, this) + ]); } GameObject.prototype.getBodyDef = function() { @@ -20,11 +26,14 @@ function (Box2D, Exception) { }; GameObject.prototype.destroy = function() { + if(this.body instanceof Box2D.Dynamics.b2Body) { this.body.GetWorld().DestroyBody(this.body); } else { throw new Exception("can not destroy body"); } + + Nc.off(this.ncTokens); }; GameObject.prototype.getBody = function() { @@ -34,6 +43,20 @@ function (Box2D, Exception) { GameObject.prototype.getPosition = function() { return this.body.GetPosition().Copy(); }; + + GameObject.prototype.setUpdateData = function(update) { + + Assert.number(update.p.x, update.p.y); + Assert.number(update.a); + Assert.number(update.lv.x, update.lv.y); + Assert.number(update.av); + + this.body.SetAwake(true); + this.body.SetPosition(update.p); + this.body.SetAngle(update.a); + this.body.SetLinearVelocity(update.lv); + this.body.SetAngularVelocity(update.av); + }; return GameObject; diff --git a/app/Game/Core/GameObjects/Item.js b/app/Game/Core/GameObjects/Item.js index b766a6f..7218d77 100644 --- a/app/Game/Core/GameObjects/Item.js +++ b/app/Game/Core/GameObjects/Item.js @@ -41,7 +41,7 @@ function (Parent, Box2D, Options, Settings, Exception, Nc, Assert) { this.body.SetBullet(true); } - Nc.trigger(Nc.ns.core.game.gameObject.add, "animated", this); + Nc.trigger(Nc.ns.core.game.worldUpdateObjects.add, this); } Item.prototype = Object.create(Parent.prototype); @@ -158,7 +158,7 @@ function (Parent, Box2D, Options, Settings, Exception, Nc, Assert) { }; Item.prototype.destroy = function() { - Nc.trigger(Nc.ns.core.game.gameObject.remove, "animated", this); + Nc.trigger(Nc.ns.core.game.worldUpdateObjects.remove, this); Parent.prototype.destroy.call(this); }; diff --git a/app/Game/Core/GameObjects/Items/RagDoll.js b/app/Game/Core/GameObjects/Items/RagDoll.js index 1d5a53e..69dd23d 100644 --- a/app/Game/Core/GameObjects/Items/RagDoll.js +++ b/app/Game/Core/GameObjects/Items/RagDoll.js @@ -378,7 +378,6 @@ function (Parent, Box2D, Settings, Nc, Assert, Options, ItemSettings) { RagDoll.prototype.destroy = function() { - Nc.trigger(Nc.ns.core.game.gameObject.remove, "animated", this); var world = this.body.GetWorld(); for (var name in this.limbs) { diff --git a/app/Game/Core/GameObjects/Items/RubeDoll.js b/app/Game/Core/GameObjects/Items/RubeDoll.js index f30d53b..d85aff2 100644 --- a/app/Game/Core/GameObjects/Items/RubeDoll.js +++ b/app/Game/Core/GameObjects/Items/RubeDoll.js @@ -138,7 +138,6 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { RubeDoll.prototype.destroy = function() { - Nc.trigger(Nc.ns.core.game.gameObject.remove, "animated", this); var world = this.body.GetWorld(); for (var name in this.limbs) { diff --git a/app/Game/Core/GameObjects/Tile.js b/app/Game/Core/GameObjects/Tile.js index 8a46fce..ec8557e 100755 --- a/app/Game/Core/GameObjects/Tile.js +++ b/app/Game/Core/GameObjects/Tile.js @@ -15,8 +15,6 @@ function (Parent, Box2D, Settings, Exception, Nc, Assert) { this.options = options; Parent.call(this, physicsEngine, uid); this.createPhysicTile(this.options); - - Nc.trigger(Nc.ns.core.game.gameObject.add, "fixed", this); } Tile.prototype = Object.create(Parent.prototype); @@ -119,10 +117,6 @@ function (Parent, Box2D, Settings, Exception, Nc, Assert) { Tile.prototype.addVec = function (vs, m1, m2) { return vs.push(new Box2D.Common.Math.b2Vec2(this.mkArg(m1), this.mkArg(m2))); }; - - Tile.prototype.destroy = function() { - Nc.trigger(Nc.ns.core.game.gameObject.remove, "fixed", this); - }; return Tile; diff --git a/app/Game/Core/Player.js b/app/Game/Core/Player.js index d40a748..025057c 100755 --- a/app/Game/Core/Player.js +++ b/app/Game/Core/Player.js @@ -27,8 +27,6 @@ function (Doll, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll this.spawned = false; this.holdingItem = null; this.spectatorDoll = new SpectatorDoll(this.physicsEngine, "spectatorDoll-" + this.id, this); - - Nc.trigger(Nc.ns.core.game.gameObject.add, 'animated', this); } Player.prototype.getNickname = function() { @@ -161,7 +159,7 @@ function (Doll, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll Player.prototype.destroy = function () { - Nc.trigger(Nc.ns.core.game.gameObject.remove, 'animated', this); + // FIXME add destroy nc hook if(this.holdingItem) { var options = { @@ -174,8 +172,10 @@ function (Doll, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll this.spectatorDoll.destroy(); + // doll destoys itself at the end cause its a gameobject + // but on userLeft, the player has to destroy it. if(this.doll) { - this.doll.destroy(); + this.doll.destroy(); } if(this.playerController) { diff --git a/app/Lib/Utilities/NotificationCenter.js b/app/Lib/Utilities/NotificationCenter.js index 62496ba..9c707c5 100755 --- a/app/Lib/Utilities/NotificationCenter.js +++ b/app/Lib/Utilities/NotificationCenter.js @@ -85,6 +85,10 @@ function (Exception) { } }, game: { + events: { + render: null, + destroy: null + }, gameStats: { toggle: null }, @@ -102,9 +106,9 @@ function (Exception) { }, core: { game: { - gameObject: { + worldUpdateObjects: { add: null, - remove: null + remove: null, }, events: { level: { @@ -241,18 +245,24 @@ function (Exception) { NotificationCenter.prototype.off = function (token) { + if(token && token.constructor === Array) { + this.offAll(token); + return; + } + for(var m in this.topics) { if (this.topics[m]) { for(var i = 0, j = this.topics[m].length; i < j; i++) { if (this.topics[m][i].token === token) { this.topics[m].splice(i, 1); - return token; + return; } } } } } + // should be treated as a private function - use Nc.off(Array); NotificationCenter.prototype.offAll = function (tokens) { for (var i = 0; i < tokens.length; i++) { this.off(tokens[i]); From 318b09ca49b39cad7d0b9c1e9069dc1dff047e69 Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 22 Jun 2015 11:58:13 +0200 Subject: [PATCH 32/68] adds warning too many recordings. fixes #132 --- server.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 16655ae..bb9586f 100755 --- a/server.js +++ b/server.js @@ -2,6 +2,7 @@ var GLOBALS = { context: "Channel" }; var requirejs = require('requirejs'); +var fs = require('fs'); var inspector; @@ -25,10 +26,17 @@ var options = { requirejs([ "Bootstrap/HttpServer", "Bootstrap/Socket", - "Server/Coordinator" + "Server/Coordinator", + "Game/Config/Settings" ], -function (HttpServer, Socket, Coordinator) { +function (HttpServer, Socket, Coordinator, Settings) { + + var records = fs.readdirSync(Settings.CHANNEL_RECORDING_PATH); + if (records.length > 200) { + console.warn('Too many recordings!'); + } + var coordinator = new Coordinator(); var httpServer = new HttpServer(options, coordinator); var socket = new Socket(httpServer.getServer(), options, coordinator); From bcecddd5bd1072ab6882808b86a16d541f68d554 Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 22 Jun 2015 12:04:33 +0200 Subject: [PATCH 33/68] added current milestone url to not_available overview --- static/html/not_available.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/html/not_available.html b/static/html/not_available.html index 40bdb04..83f4670 100644 --- a/static/html/not_available.html +++ b/static/html/not_available.html @@ -75,7 +75,7 @@ $.get(url, function( data ) { var progress = parseInt(milestone.closed_issues) / (parseInt(milestone.open_issues)+parseInt(milestone.closed_issues)); progress = Math.round(progress * 100); - $("#m-title").text(milestone.title); + $("#m-title").html('' + milestone.title + ''); $("#m-open").text(milestone.open_issues); $("#m-closed").text(milestone.closed_issues); $("#m-progress").text(progress + "%"); From 8f7be70407572a960bde0f403951736cb00bf89e Mon Sep 17 00:00:00 2001 From: Karl Date: Sun, 28 Jun 2015 17:06:52 +0200 Subject: [PATCH 34/68] adds video image --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cae17cf..956e9b6 100755 --- a/README.md +++ b/README.md @@ -2,8 +2,10 @@ chuck.js ======== Physical JavaScript Action Browser Multiplayer Game - it will be awesome! - -[![Foo](http://25.media.tumblr.com/8249dcd3bdb176686421d1914937db1c/tumblr_mzc1ejGxNC1ry8awho1_400.png)](http://chuck-game.tumblr.com/ "Screenshot of chuck.js - click to visit our development blog!") + + + + Follow the development at http://chuck-game.tumblr.com/ From 71db5a8a810296955430c9f048eae6d207504e3c Mon Sep 17 00:00:00 2001 From: logsol Date: Sun, 28 Jun 2015 19:11:37 +0200 Subject: [PATCH 35/68] removes flashsocket - fixes #117 --- app/Bootstrap/Socket.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Bootstrap/Socket.js b/app/Bootstrap/Socket.js index 3765c0b..128a70f 100755 --- a/app/Bootstrap/Socket.js +++ b/app/Bootstrap/Socket.js @@ -22,10 +22,12 @@ function (io) { var self = this; this.socket.configure('development', function () { this.set('log level', options.logLevel); + this.set('transports', ['websocket']); }); this.socket.configure('production', function () { this.set('log level', options.logLevel); + this.set('transports', ['websocket']); }); this.socket.on('connection', function (user) { From eb29a000125451a8f5590d99d6c7405b93ca489e Mon Sep 17 00:00:00 2001 From: logsol Date: Sun, 28 Jun 2015 19:44:26 +0200 Subject: [PATCH 36/68] only adds lastMovedBy when there was no damage - fixes #108 --- app/Game/Channel/GameObjects/Doll.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Game/Channel/GameObjects/Doll.js b/app/Game/Channel/GameObjects/Doll.js index 9d109a4..10516ba 100755 --- a/app/Game/Channel/GameObjects/Doll.js +++ b/app/Game/Channel/GameObjects/Doll.js @@ -54,6 +54,7 @@ function (Parent, Item, Box2D, Nc, Assert) { var b2Math = Box2D.Common.Math.b2Math; var absItemVelocity = b2Math.AbsV(itemVelocity); var min = 1; + var damage = 0; if(absItemVelocity.x > min || absItemVelocity.y > min) { if(item.lastMoved && item.lastMoved.player != this.player) { @@ -72,7 +73,7 @@ function (Parent, Item, Box2D, Nc, Assert) { // + 0.5 and / 2: offsetting for lower velocity impact // * 300: tested imperically by throwing piano from deadly height // * 80: tested imperically by throwing knife fast - var damage = (velocityDamage + 0.5) * (weightDamage * 300 + dangerDamage * 80) / 2; + damage = (velocityDamage + 0.5) * (weightDamage * 300 + dangerDamage * 80) / 2; var lastMovedPlayer = item.lastMoved.player; var callback = function() { @@ -83,7 +84,10 @@ function (Parent, Item, Box2D, Nc, Assert) { } } - item.setLastMovedBy(this.player); + // only set lastMovedBy if player wasn't hurt by collision + if (damage === 0) { + item.setLastMovedBy(this.player); + } } } } From 7cd4cc702b2a2e4836a4dc9bb781f86138ca36c9 Mon Sep 17 00:00:00 2001 From: logsol Date: Sun, 28 Jun 2015 20:11:28 +0200 Subject: [PATCH 37/68] should fix a bug happening on live deployment --- app/Game/Asset/RubeDoll.json | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Game/Asset/RubeDoll.json b/app/Game/Asset/RubeDoll.json index a7b9312..0ea7dc3 100644 --- a/app/Game/Asset/RubeDoll.json +++ b/app/Game/Asset/RubeDoll.json @@ -1,4 +1,3 @@ - { "allowSleep" : true, "autoClearForces" : true, From db954652088a093cdb3b26c71f8882541ffda13a Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 29 Jun 2015 01:24:05 +0200 Subject: [PATCH 38/68] fixed a bug in gangsta level --- static/maps/tiled/gangsta.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/maps/tiled/gangsta.json b/static/maps/tiled/gangsta.json index c5e15f6..ce186df 100644 --- a/static/maps/tiled/gangsta.json +++ b/static/maps/tiled/gangsta.json @@ -80,7 +80,7 @@ { "height":0, "id":25, - "name":"Rube", + "name":"Television", "properties": { From 2e01a093fc9310795ba5a1edad14e540c2ac5621 Mon Sep 17 00:00:00 2001 From: Jeena Date: Sun, 28 Jun 2015 16:26:52 -0700 Subject: [PATCH 39/68] first step of rotating limbs in RubeDoll --- app/Game/Client/GameObjects/Items/RubeDoll.js | 4 ++-- app/Game/Config/ItemSettings.js | 2 +- app/Game/Config/Settings.js | 4 ++-- app/Game/Core/GameObjects/Items/RubeDoll.js | 24 ++++++++++++++----- static/maps/tiled/debug.json | 2 +- 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/app/Game/Client/GameObjects/Items/RubeDoll.js b/app/Game/Client/GameObjects/Items/RubeDoll.js index bed947c..0d26139 100644 --- a/app/Game/Client/GameObjects/Items/RubeDoll.js +++ b/app/Game/Client/GameObjects/Items/RubeDoll.js @@ -95,8 +95,6 @@ function (Parent, Layer, Settings, Nc) { this.characterName = "Chuck"; this.lastFlipDirection = -options.direction || 1; - console.log(this.lastFlipDirection); - Parent.call(this, physicsEngine, uid, options); } @@ -169,6 +167,8 @@ function (Parent, Layer, Settings, Nc) { }; RubeDoll.prototype.render = function() { + Parent.prototype.render.call(this); + if(this.limbs) { for(var name in this.limbMeshes) { if(this.limbs[name]) { diff --git a/app/Game/Config/ItemSettings.js b/app/Game/Config/ItemSettings.js index 532d6fc..bd3b282 100644 --- a/app/Game/Config/ItemSettings.js +++ b/app/Game/Config/ItemSettings.js @@ -421,7 +421,7 @@ function () { "height": "9", "type": "rubedoll", - "grabAngle": "0", + "grabAngle": "0.1", } }; diff --git a/app/Game/Config/Settings.js b/app/Game/Config/Settings.js index 4e2f669..4cc8800 100755 --- a/app/Game/Config/Settings.js +++ b/app/Game/Config/Settings.js @@ -16,8 +16,8 @@ function () { BOX2D_WORLD_AABB_SIZE: 3000, BOX2D_ALLOW_SLEEP: true, BOX2D_GRAVITY: 26, - BOX2D_VELOCITY_ITERATIONS: 10, - BOX2D_POSITION_ITERATIONS: 6, + BOX2D_VELOCITY_ITERATIONS: 200, + BOX2D_POSITION_ITERATIONS: 100, BOX2D_TIME_STEP: 1 / 60, // PATHS diff --git a/app/Game/Core/GameObjects/Items/RubeDoll.js b/app/Game/Core/GameObjects/Items/RubeDoll.js index d85aff2..367435c 100644 --- a/app/Game/Core/GameObjects/Items/RubeDoll.js +++ b/app/Game/Core/GameObjects/Items/RubeDoll.js @@ -30,6 +30,7 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { Parent.call(this, physicsEngine, uid, options); world.DestroyBody(this.body); this.body = this.limbs.chest; + delete this.limbs.chest; this.body.SetUserData(this); @@ -80,7 +81,9 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { }; RubeDoll.prototype.flip = function(direction) { + Parent.prototype.flip.call(this, direction); + /* for (var i in this.joints) { var joint = this.joints[i]; @@ -102,19 +105,28 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { joint.SetLimits(a2, a1); } } - } + }*/ }; RubeDoll.prototype.reposition = function(handPosition, direction) { + var oldPosition = this.getPosition(); + Parent.prototype.reposition.call(this, handPosition, direction); - var position = new Box2D.Common.Math.b2Vec2( - handPosition.x + ((6 / Settings.RATIO) * direction), - handPosition.y - ); + //this.body.SetType(Box2D.Dynamics.b2Body.b2_staticBody) + + var newPosition = this.getPosition(); + var b2Math = Box2D.Common.Math.b2Math; + var offset = b2Math.SubtractVV(newPosition, oldPosition); + + for(var limb in this.limbs) { + var position = this.limbs[limb].GetPosition().Copy(); + position.Add(offset); + this.limbs[limb].SetPosition(position); + //this.limbs[limb].SetType(Box2D.Dynamics.b2Body.b2_staticBody) + } - this.body.SetPosition(position); }; RubeDoll.prototype.setVelocities = function(options) { diff --git a/static/maps/tiled/debug.json b/static/maps/tiled/debug.json index b26ed3f..120737a 100644 --- a/static/maps/tiled/debug.json +++ b/static/maps/tiled/debug.json @@ -225,7 +225,7 @@ "visible":true, "width":0, "x":504.607333333333, - "y":111.255333333333 + "y":433.26 }, { "height":0, From e370adf74673645dce5f370cea72b9ea8074e992 Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 29 Jun 2015 01:29:57 +0200 Subject: [PATCH 40/68] worldupdate subbody repositioning - #99 --- .../Channel/GameObjects/Items/RubeDoll.js | 24 +++++++++++++++++++ app/Game/Core/GameObjects/Items/RubeDoll.js | 18 ++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/app/Game/Channel/GameObjects/Items/RubeDoll.js b/app/Game/Channel/GameObjects/Items/RubeDoll.js index dfad73f..def8c0e 100644 --- a/app/Game/Channel/GameObjects/Items/RubeDoll.js +++ b/app/Game/Channel/GameObjects/Items/RubeDoll.js @@ -43,6 +43,30 @@ function (Parent, Settings, Nc) { }, Settings.RAGDOLL_DESTRUCTION_TIME * 1000); }; + RubeDoll.prototype.getUpdateData = function(getSleeping) { + var updateData = Parent.prototype.getUpdateData.call(this, getSleeping); + + // if parent is asleep it sends null, to do no update + if(!updateData) { + return updateData; + } + + // adding limb update data + var limbUpdateData = {}; + + for(var name in this.limbs) { + limbUpdateData[name] = { + p: this.limbs[name].GetPosition(), + a: this.limbs[name].GetAngle(), + lv: this.limbs[name].GetLinearVelocity(), + av: this.limbs[name].GetAngularVelocity() + }; + } + updateData['limbs'] = limbUpdateData; + + return updateData; + } + RubeDoll.prototype.destroy = function() { if(this.scheduledForDestruction) { clearTimeout(this.destructionTimeout); diff --git a/app/Game/Core/GameObjects/Items/RubeDoll.js b/app/Game/Core/GameObjects/Items/RubeDoll.js index 367435c..3a0d683 100644 --- a/app/Game/Core/GameObjects/Items/RubeDoll.js +++ b/app/Game/Core/GameObjects/Items/RubeDoll.js @@ -148,6 +148,24 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { return this.limbs.head.GetPosition().Copy(); }; + RubeDoll.prototype.setUpdateData = function(update) { + + Parent.prototype.setUpdateData.call(this, update); + + for(var name in update.limbs) { + Assert.number(update.limbs[name].p.x, update.limbs[name].p.y); + Assert.number(update.limbs[name].a); + Assert.number(update.limbs[name].lv.x, update.limbs[name].lv.y); + Assert.number(update.limbs[name].av); + + this.limbs[name].SetAwake(true); + this.limbs[name].SetPosition(update.limbs[name].p); + this.limbs[name].SetAngle(update.limbs[name].a); + this.limbs[name].SetLinearVelocity(update.limbs[name].lv); + this.limbs[name].SetAngularVelocity(update.limbs[name].av); + } + } + RubeDoll.prototype.destroy = function() { var world = this.body.GetWorld(); From 0edde06d67b2f46d7a8edf5ae8e2f992c852ccd6 Mon Sep 17 00:00:00 2001 From: logsol Date: Sun, 2 Aug 2015 11:38:45 +0200 Subject: [PATCH 41/68] only adds lastMovedBy when there was no damage - fixes #99 --- app/Game/Channel/Control/PlayerController.js | 6 +- app/Game/Client/GameObjects/Items/RubeDoll.js | 16 +- app/Game/Config/ItemSettings.js | 2 +- app/Game/Config/Settings.js | 4 +- app/Game/Core/GameObjects/Item.js | 2 +- app/Game/Core/GameObjects/Items/RagDoll.js | 2 +- app/Game/Core/GameObjects/Items/RubeDoll.js | 58 ++- app/Lib/Utilities/Matrix.js | 334 ++++++++++++++++++ 8 files changed, 403 insertions(+), 21 deletions(-) create mode 100644 app/Lib/Utilities/Matrix.js diff --git a/app/Game/Channel/Control/PlayerController.js b/app/Game/Channel/Control/PlayerController.js index cf7a306..20d37a6 100755 --- a/app/Game/Channel/Control/PlayerController.js +++ b/app/Game/Channel/Control/PlayerController.js @@ -35,9 +35,9 @@ function(Parent, Nc, Parser, Settings) { }; PlayerController.prototype.handActionRequest = function(options) { - options.x = parseFloat(options.x) || 0; - options.y = parseFloat(options.y) || 0; - options.av = parseFloat(options.av) || 0; + options.x = parseFloat(options.x) || 0.0; + options.y = parseFloat(options.y) || 0.0; + options.av = parseFloat(options.av) || 0.0; if (options) this.player.handActionRequest(options); }; diff --git a/app/Game/Client/GameObjects/Items/RubeDoll.js b/app/Game/Client/GameObjects/Items/RubeDoll.js index 0d26139..c494b77 100644 --- a/app/Game/Client/GameObjects/Items/RubeDoll.js +++ b/app/Game/Client/GameObjects/Items/RubeDoll.js @@ -167,7 +167,17 @@ function (Parent, Layer, Settings, Nc) { }; RubeDoll.prototype.render = function() { - Parent.prototype.render.call(this); + //Parent.prototype.render.call(this); + + Nc.trigger(Nc.ns.client.view.mesh.update, + this.layerId, + this.mesh, + { + x: this.body.GetPosition().x * Settings.RATIO, + y: this.body.GetPosition().y * Settings.RATIO, + rotation: this.body.GetAngle() + } + ); if(this.limbs) { for(var name in this.limbMeshes) { @@ -187,6 +197,10 @@ function (Parent, Layer, Settings, Nc) { }; RubeDoll.prototype.flip = function(direction) { + return; + + + Parent.prototype.flip.call(this, direction); // flipping depth of right body side arm/leg images with left diff --git a/app/Game/Config/ItemSettings.js b/app/Game/Config/ItemSettings.js index bd3b282..28ccd63 100644 --- a/app/Game/Config/ItemSettings.js +++ b/app/Game/Config/ItemSettings.js @@ -421,7 +421,7 @@ function () { "height": "9", "type": "rubedoll", - "grabAngle": "0.1", + "grabAngle": "0.001", // seems to be a bug, that 0 does not work! } }; diff --git a/app/Game/Config/Settings.js b/app/Game/Config/Settings.js index 4cc8800..7c43411 100755 --- a/app/Game/Config/Settings.js +++ b/app/Game/Config/Settings.js @@ -16,8 +16,8 @@ function () { BOX2D_WORLD_AABB_SIZE: 3000, BOX2D_ALLOW_SLEEP: true, BOX2D_GRAVITY: 26, - BOX2D_VELOCITY_ITERATIONS: 200, - BOX2D_POSITION_ITERATIONS: 100, + BOX2D_VELOCITY_ITERATIONS: 20, + BOX2D_POSITION_ITERATIONS: 10, // 200/100 created problems (awful teleporting when repositioning joints) BOX2D_TIME_STEP: 1 / 60, // PATHS diff --git a/app/Game/Core/GameObjects/Item.js b/app/Game/Core/GameObjects/Item.js index 7218d77..0662ee4 100644 --- a/app/Game/Core/GameObjects/Item.js +++ b/app/Game/Core/GameObjects/Item.js @@ -129,7 +129,7 @@ function (Parent, Box2D, Options, Settings, Exception, Nc, Assert) { ); this.body.SetPosition(position); this.flip(direction); - this.body.SetAngle((this.options.grabAngle || 0) * direction); + this.body.SetAngle((this.options.grabAngle || 0.0) * direction); }; Item.prototype.getGrabPoint = function() { diff --git a/app/Game/Core/GameObjects/Items/RagDoll.js b/app/Game/Core/GameObjects/Items/RagDoll.js index 69dd23d..bfd284b 100644 --- a/app/Game/Core/GameObjects/Items/RagDoll.js +++ b/app/Game/Core/GameObjects/Items/RagDoll.js @@ -352,7 +352,7 @@ function (Parent, Box2D, Settings, Nc, Assert, Options, ItemSettings) { chestPosition.y + this.options.limbs.head.y / Settings.RATIO ); this.limbs.head.SetPosition(position); - this.limbs.head.SetAngle((this.options.grabAngle || 0) * direction); + this.limbs.head.SetAngle((this.options.grabAngle || 0.0) * direction); }; RagDoll.prototype.throw = function(options, carrierVelocity) { diff --git a/app/Game/Core/GameObjects/Items/RubeDoll.js b/app/Game/Core/GameObjects/Items/RubeDoll.js index 3a0d683..215a406 100644 --- a/app/Game/Core/GameObjects/Items/RubeDoll.js +++ b/app/Game/Core/GameObjects/Items/RubeDoll.js @@ -5,10 +5,11 @@ define([ "Game/Config/Settings", "Lib/Utilities/Assert", "Lib/Utilities/NotificationCenter", + "Lib/Utilities/Matrix", "json!Game/Asset/RubeDoll.json" // using requirejs json loader plugin ], -function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { +function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, Matrix, RubeDollJson) { "use strict"; @@ -66,11 +67,21 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { this.joints = scene.joints; + var count = 0; for (var i in this.joints) { this.limits[i] = { lower: this.joints[i].GetLowerLimit(), upper: this.joints[i].GetUpperLimit(), }; + + this.joints[i].EnableLimit(false); + + if(count < 4 && this.joints[i] instanceof Box2D.Dynamics.Joints.b2RevoluteJoint) { + console.log(i); + } else { + body.GetWorld().DestroyJoint(this.joints[i]); + } + count++; } }; @@ -82,7 +93,7 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { RubeDoll.prototype.flip = function(direction) { - Parent.prototype.flip.call(this, direction); + //Parent.prototype.flip.call(this, direction); /* for (var i in this.joints) { @@ -109,24 +120,45 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { }; RubeDoll.prototype.reposition = function(handPosition, direction) { + console.log('repo'); var oldPosition = this.getPosition(); - + var oldAngle = this.body.GetAngle(); Parent.prototype.reposition.call(this, handPosition, direction); + var differenceAngle = oldAngle - this.body.GetAngle(); - //this.body.SetType(Box2D.Dynamics.b2Body.b2_staticBody) + //this.body.SetLinearVelocity(new Box2D.Common.Math.b2Vec2(0, 0)); - var newPosition = this.getPosition(); - var b2Math = Box2D.Common.Math.b2Math; - var offset = b2Math.SubtractVV(newPosition, oldPosition); + var offset = Box2D.Common.Math.b2Math.SubtractVV(this.getPosition(), oldPosition); + var grabAngle = (this.options.grabAngle || 0.001); - for(var limb in this.limbs) { - var position = this.limbs[limb].GetPosition().Copy(); + for(var key in this.limbs) { + var limb = this.limbs[key]; + + // Setting position offset first (floor to hand) + var position = limb.GetPosition().Copy(); position.Add(offset); - this.limbs[limb].SetPosition(position); - //this.limbs[limb].SetType(Box2D.Dynamics.b2Body.b2_staticBody) - } + limb.SetPosition(position); + // grabing local point to "rotate" around (x, y position transform only) + var localPoint = this.body.GetLocalPoint(limb.GetPosition().Copy()); + + // create rotation matrix from chest rotation difference + var mat = Box2D.Common.Math.b2Mat22.FromAngle(differenceAngle); + + // matrix multiplication with local limb position + position = Box2D.Common.Math.b2Math.MulTMV(mat, localPoint); + + // translating back to global position + var globalPoint = this.body.GetWorldPoint(position); + limb.SetPosition(globalPoint); + + // relative limb rotating by chest rotation difference + limb.SetAngle(limb.GetAngle() - differenceAngle); + + //limb.SetType(Box2D.Dynamics.b2Body.b2_staticBody); + //limb.SetLinearVelocity(new Box2D.Common.Math.b2Vec2(0, 0)); + } }; RubeDoll.prototype.setVelocities = function(options) { @@ -152,6 +184,7 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { Parent.prototype.setUpdateData.call(this, update); +/* for(var name in update.limbs) { Assert.number(update.limbs[name].p.x, update.limbs[name].p.y); Assert.number(update.limbs[name].a); @@ -164,6 +197,7 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, RubeDollJson) { this.limbs[name].SetLinearVelocity(update.limbs[name].lv); this.limbs[name].SetAngularVelocity(update.limbs[name].av); } + */ } RubeDoll.prototype.destroy = function() { diff --git a/app/Lib/Utilities/Matrix.js b/app/Lib/Utilities/Matrix.js new file mode 100644 index 0000000..c912d41 --- /dev/null +++ b/app/Lib/Utilities/Matrix.js @@ -0,0 +1,334 @@ +define([ +], + +/* + Stolen from Pixi V2 +*/ + +function () { + + "use strict"; + + /** + * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis. + * + * @class Point + * @constructor + * @param x {Number} position of the point on the x axis + * @param y {Number} position of the point on the y axis + */ + var Point = function(x, y) + { + /** + * @property x + * @type Number + * @default 0 + */ + this.x = x || 0; + + /** + * @property y + * @type Number + * @default 0 + */ + this.y = y || 0; + }; + + /** + * Creates a clone of this point + * + * @method clone + * @return {Point} a copy of the point + */ + Point.prototype.clone = function() + { + return new Point(this.x, this.y); + }; + + /** + * Sets the point to a new x and y position. + * If y is omitted, both x and y will be set to x. + * + * @method set + * @param [x=0] {Number} position of the point on the x axis + * @param [y=0] {Number} position of the point on the y axis + */ + Point.prototype.set = function(x, y) + { + this.x = x || 0; + this.y = y || ( (y !== 0) ? this.x : 0 ) ; + }; + + // constructor + Point.prototype.constructor = Point; + + /** + * @author Mat Groves http://matgroves.com/ @Doormat23 + */ + + /** + * The Matrix class is now an object, which makes it a lot faster, + * here is a representation of it : + * | a | b | tx| + * | c | d | ty| + * | 0 | 0 | 1 | + * + * @class Matrix + * @constructor + */ + var Matrix = function() + { + /** + * @property a + * @type Number + * @default 1 + */ + this.a = 1; + + /** + * @property b + * @type Number + * @default 0 + */ + this.b = 0; + + /** + * @property c + * @type Number + * @default 0 + */ + this.c = 0; + + /** + * @property d + * @type Number + * @default 1 + */ + this.d = 1; + + /** + * @property tx + * @type Number + * @default 0 + */ + this.tx = 0; + + /** + * @property ty + * @type Number + * @default 0 + */ + this.ty = 0; + }; + + /** + * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows: + * + * a = array[0] + * b = array[1] + * c = array[3] + * d = array[4] + * tx = array[2] + * ty = array[5] + * + * @method fromArray + * @param array {Array} The array that the matrix will be populated from. + */ + Matrix.prototype.fromArray = function(array) + { + this.a = array[0]; + this.b = array[1]; + this.c = array[3]; + this.d = array[4]; + this.tx = array[2]; + this.ty = array[5]; + }; + + /** + * Creates an array from the current Matrix object. + * + * @method toArray + * @param transpose {Boolean} Whether we need to transpose the matrix or not + * @return {Array} the newly created array which contains the matrix + */ + Matrix.prototype.toArray = function(transpose) + { + if(!this.array) this.array = new Float32Array(9); + var array = this.array; + + if(transpose) + { + array[0] = this.a; + array[1] = this.b; + array[2] = 0; + array[3] = this.c; + array[4] = this.d; + array[5] = 0; + array[6] = this.tx; + array[7] = this.ty; + array[8] = 1; + } + else + { + array[0] = this.a; + array[1] = this.c; + array[2] = this.tx; + array[3] = this.b; + array[4] = this.d; + array[5] = this.ty; + array[6] = 0; + array[7] = 0; + array[8] = 1; + } + + return array; + }; + + /** + * Get a new position with the current transformation applied. + * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering) + * + * @method apply + * @param pos {Point} The origin + * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) + * @return {Point} The new point, transformed through this matrix + */ + Matrix.prototype.apply = function(pos, newPos) + { + newPos = newPos || new Point(); + + newPos.x = this.a * pos.x + this.c * pos.y + this.tx; + newPos.y = this.b * pos.x + this.d * pos.y + this.ty; + + return newPos; + }; + + /** + * Get a new position with the inverse of the current transformation applied. + * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input) + * + * @method applyInverse + * @param pos {Point} The origin + * @param [newPos] {Point} The point that the new position is assigned to (allowed to be same as input) + * @return {Point} The new point, inverse-transformed through this matrix + */ + Matrix.prototype.applyInverse = function(pos, newPos) + { + newPos = newPos || new Point(); + + var id = 1 / (this.a * this.d + this.c * -this.b); + + newPos.x = this.d * id * pos.x + -this.c * id * pos.y + (this.ty * this.c - this.tx * this.d) * id; + newPos.y = this.a * id * pos.y + -this.b * id * pos.x + (-this.ty * this.a + this.tx * this.b) * id; + + return newPos; + }; + + /** + * Translates the matrix on the x and y. + * + * @method translate + * @param {Number} x + * @param {Number} y + * @return {Matrix} This matrix. Good for chaining method calls. + **/ + Matrix.prototype.translate = function(x, y) + { + this.tx += x; + this.ty += y; + + return this; + }; + + /** + * Applies a scale transformation to the matrix. + * + * @method scale + * @param {Number} x The amount to scale horizontally + * @param {Number} y The amount to scale vertically + * @return {Matrix} This matrix. Good for chaining method calls. + **/ + Matrix.prototype.scale = function(x, y) + { + this.a *= x; + this.d *= y; + this.c *= x; + this.b *= y; + this.tx *= x; + this.ty *= y; + + return this; + }; + + + /** + * Applies a rotation transformation to the matrix. + * @method rotate + * @param {Number} angle The angle in radians. + * @return {Matrix} This matrix. Good for chaining method calls. + **/ + Matrix.prototype.rotate = function(angle) + { + var cos = Math.cos( angle ); + var sin = Math.sin( angle ); + + var a1 = this.a; + var c1 = this.c; + var tx1 = this.tx; + + this.a = a1 * cos-this.b * sin; + this.b = a1 * sin+this.b * cos; + this.c = c1 * cos-this.d * sin; + this.d = c1 * sin+this.d * cos; + this.tx = tx1 * cos - this.ty * sin; + this.ty = tx1 * sin + this.ty * cos; + + return this; + }; + + /** + * Appends the given Matrix to this Matrix. + * + * @method append + * @param {Matrix} matrix + * @return {Matrix} This matrix. Good for chaining method calls. + */ + Matrix.prototype.append = function(matrix) + { + var a1 = this.a; + var b1 = this.b; + var c1 = this.c; + var d1 = this.d; + + this.a = matrix.a * a1 + matrix.b * c1; + this.b = matrix.a * b1 + matrix.b * d1; + this.c = matrix.c * a1 + matrix.d * c1; + this.d = matrix.c * b1 + matrix.d * d1; + + this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx; + this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty; + + return this; + }; + + /** + * Resets this Matix to an identity (default) matrix. + * + * @method identity + * @return {Matrix} This matrix. Good for chaining method calls. + */ + Matrix.prototype.identity = function() + { + this.a = 1; + this.b = 0; + this.c = 0; + this.d = 1; + this.tx = 0; + this.ty = 0; + + return this; + }; + + return Matrix; + +}); \ No newline at end of file From a8adbcf1404cbe489c30e08bac45fccff9737b07 Mon Sep 17 00:00:00 2001 From: Jeena Date: Sun, 2 Aug 2015 16:06:32 +0200 Subject: [PATCH 42/68] fixes position state update and removes dev graphs for better fps --- app/Game/Channel/Control/PlayerController.js | 4 +- app/Game/Client/GameController.js | 23 ++++++++++-- app/Game/Client/Me.js | 5 ++- app/Game/Client/View/DomController.js | 39 +++++++++++++------- app/Game/Core/GameController.js | 11 +++--- static/maps/tiled/debug.json | 2 +- 6 files changed, 55 insertions(+), 29 deletions(-) diff --git a/app/Game/Channel/Control/PlayerController.js b/app/Game/Channel/Control/PlayerController.js index cf7a306..8da9da3 100755 --- a/app/Game/Channel/Control/PlayerController.js +++ b/app/Game/Channel/Control/PlayerController.js @@ -45,7 +45,7 @@ function(Parent, Nc, Parser, Settings) { this.player.suicide(); }; - PlayerController.prototype.mePositionStateUpdate = function(update) { + PlayerController.prototype.mePositionStateOverride = function(update) { if(!this.player.isSpawned()) { // if someone still falls but is dead on the server already @@ -57,7 +57,7 @@ function(Parent, Nc, Parser, Settings) { y: Math.abs(update.p.y - this.player.doll.body.GetPosition().y) }; - if(true || difference.x < Settings.PUNKBUSTER_DIFFERENCE_METERS && + if(difference.x < Settings.PUNKBUSTER_DIFFERENCE_METERS && difference.y < Settings.PUNKBUSTER_DIFFERENCE_METERS) { this.player.doll.updatePositionState(update); } else { diff --git a/app/Game/Client/GameController.js b/app/Game/Client/GameController.js index b64ea92..39e7eb4 100755 --- a/app/Game/Client/GameController.js +++ b/app/Game/Client/GameController.js @@ -52,7 +52,7 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque if(this.me) { this.me.update(); - this.mePositionStateUpdate(); + this.mePositionStateOverride(); } //for (var uid in this.gameObjects.animated) { @@ -65,9 +65,13 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque DomController.fpsStep(); }; - GameController.prototype.mePositionStateUpdate = function() { - if(this.me.isPositionStateUpdateNeeded()) { - Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "mePositionStateUpdate", this.me.getPositionStateUpdate()); + GameController.prototype.mePositionStateOverride = function() { + if(this.me.isPositionStateOverrideNeeded()) { + Nc.trigger( + Nc.ns.client.to.server.gameCommand.send, + "mePositionStateOverride", + this.me.getPositionStateOverride() + ); } }; @@ -126,6 +130,17 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque }; */ + GameController.prototype.updateGameObject = function (gameObject, gameObjectUpdate) { + if(gameObject === this.me.doll) { + this.me.setLastServerPositionState(gameObjectUpdate); + if(!this.me.acceptPositionStateUpdateFromServer()) { + return; // this is to ignore own doll updates from world update + } + } + + Parent.prototype.updateGameObject.call(this, gameObject, gameObjectUpdate); + } + GameController.prototype.createMe = function(user) { this.me = new Me(user.id, this.physicsEngine, user); this.players[user.id] = this.me; diff --git a/app/Game/Client/Me.js b/app/Game/Client/Me.js index 047befd..64d1e2f 100644 --- a/app/Game/Client/Me.js +++ b/app/Game/Client/Me.js @@ -51,7 +51,8 @@ function (Parent, Settings, Nc, Assert) { this.lastServerPositionState = update; }; - Me.prototype.isPositionStateUpdateNeeded = function() { + // Checks if client should send out its position to server + Me.prototype.isPositionStateOverrideNeeded = function() { if(!this.doll) { return false; @@ -73,7 +74,7 @@ function (Parent, Settings, Nc, Assert) { return false; }; - Me.prototype.getPositionStateUpdate = function() { + Me.prototype.getPositionStateOverride = function() { return { p: this.doll.body.GetPosition().Copy(), lv: this.doll.body.GetLinearVelocity().Copy() diff --git a/app/Game/Client/View/DomController.js b/app/Game/Client/View/DomController.js index bb4c74d..f50f170 100755 --- a/app/Game/Client/View/DomController.js +++ b/app/Game/Client/View/DomController.js @@ -15,18 +15,19 @@ function (Settings, Nc, Screenfull, Graph, PointerLockManager) { this.stats = null; this.ping = null; this.nickContainer = null; - this.fpsContainer = ""; + this.fpsContainer = null; this.devToolsContainer = null; + this.frames = 0; + + this.canvas = document.getElementById("canvas"); this.initDevTools(); } DomController.prototype.initDevTools = function() { - var self = this; var li, button, label; - this.canvas = document.getElementById("canvas"); this.devToolsContainer = document.getElementById("menuBar"); // create back to menu button @@ -48,6 +49,16 @@ function (Settings, Nc, Screenfull, Graph, PointerLockManager) { this.devToolsContainer.appendChild(li); this.nickContainer = label; + + // create fps label with updater + li = document.createElement("li"); + label = document.createElement("label"); + label.id = "label-fps"; + li.appendChild(label); + this.devToolsContainer.appendChild(li); + this.fpsContainer = label; + +/* // create new fps meter li = document.createElement("li"); var fpsCanvas = document.createElement("canvas"); @@ -59,14 +70,6 @@ function (Settings, Nc, Screenfull, Graph, PointerLockManager) { this.fpsGraph = new Graph(fpsCanvas.getContext("2d"), true); - // create fps label with updater - li = document.createElement("li"); - label = document.createElement("label"); - label.id = "label-fps"; - li.appendChild(label); - this.devToolsContainer.appendChild(li); - this.fpsContainer = label; - this.fpsGraph.onUpdate(function(value){ self.fpsContainer.innerHTML = "FPS:" + value; @@ -99,6 +102,12 @@ function (Settings, Nc, Screenfull, Graph, PointerLockManager) { scaleStepWidth: 0, scaleSteps: 0 }); +*/ + + setInterval(function() { + self.fpsContainer.innerHTML = "FPS:" + self.frames; + self.frames = 0; + }, 1000); // create Ping: container li = document.createElement("li"); @@ -147,12 +156,13 @@ function (Settings, Nc, Screenfull, Graph, PointerLockManager) { }; DomController.prototype.fpsStep = function() { - this.fpsGraph.step(); + this.frames++; + // this.fpsGraph.step(); }; DomController.prototype.setPing = function(ping) { this.ping.innerHTML = "Ping:" + ping; - this.pingGraph.addValue(ping); + // this.pingGraph.addValue(ping); }; DomController.prototype.getCanvasContainer = function () { @@ -180,13 +190,14 @@ function (Settings, Nc, Screenfull, Graph, PointerLockManager) { document.body.style.backgroundColor = '#aaaaaa'; this.ping.innerHTML = "Disconnected. ".replace(/ /g, ' '); this.ping.style.color = "#ff0000"; - + /* self = this; setTimeout(function(){self.ping.innerHTML = "Reload Page...".replace(/ /g, ' ');}, 3000); setTimeout(function(){self.ping.innerHTML = "Reload in 3...".replace(/ /g, ' ');}, 6000); setTimeout(function(){self.ping.innerHTML = "Reload in 2...".replace(/ /g, ' ');}, 7000); setTimeout(function(){self.ping.innerHTML = "Reload in 1...".replace(/ /g, ' ');}, 8000); setTimeout(function(){self.ping.innerHTML = "Reload now. ".replace(/ /g, ' '); location.reload(); }, 9000); + */ } }; diff --git a/app/Game/Core/GameController.js b/app/Game/Core/GameController.js index 5274bdb..04a4c6d 100755 --- a/app/Game/Core/GameController.js +++ b/app/Game/Core/GameController.js @@ -79,15 +79,14 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert) continue; } - gameObject.setUpdateData(updateData[uid]); + this.updateGameObject(gameObject, updateData[uid]); } }; -/* - GameController.prototype.onWorldUpdateGameObject = function(body, gameObject, update) { - FIXME : call gameObject.setUpdateData(updateData[uid]); - }; -*/ + + GameController.prototype.updateGameObject = function(gameObject, gameObjectUpdate) { + gameObject.setUpdateData(gameObjectUpdate); + } GameController.prototype.onResetLevel = function() { this.loadLevel(this.level.uid); diff --git a/static/maps/tiled/debug.json b/static/maps/tiled/debug.json index b26ed3f..21c0db6 100644 --- a/static/maps/tiled/debug.json +++ b/static/maps/tiled/debug.json @@ -215,7 +215,7 @@ { "height":0, "id":10, - "name":"RubeDoll", + "name":"Small Cleaver", "properties": { From f35b9f5ba9d5e27383607eed8ee906a6fda0378f Mon Sep 17 00:00:00 2001 From: Jeena Date: Sun, 2 Aug 2015 17:22:41 +0200 Subject: [PATCH 43/68] fixed flip for RubeDoll --- app/Game/Client/GameObjects/Items/RubeDoll.js | 3 -- app/Game/Config/ItemSettings.js | 2 +- app/Game/Core/GameObjects/Item.js | 2 +- app/Game/Core/GameObjects/Items/RubeDoll.js | 51 +++++++++++-------- static/maps/tiled/debug.json | 2 +- 5 files changed, 33 insertions(+), 27 deletions(-) diff --git a/app/Game/Client/GameObjects/Items/RubeDoll.js b/app/Game/Client/GameObjects/Items/RubeDoll.js index c494b77..6c848a2 100644 --- a/app/Game/Client/GameObjects/Items/RubeDoll.js +++ b/app/Game/Client/GameObjects/Items/RubeDoll.js @@ -197,9 +197,6 @@ function (Parent, Layer, Settings, Nc) { }; RubeDoll.prototype.flip = function(direction) { - return; - - Parent.prototype.flip.call(this, direction); diff --git a/app/Game/Config/ItemSettings.js b/app/Game/Config/ItemSettings.js index 28ccd63..8724c0a 100644 --- a/app/Game/Config/ItemSettings.js +++ b/app/Game/Config/ItemSettings.js @@ -417,7 +417,7 @@ function () { "image": "banana.gif", "weight": "3", - "width": "5", + "width": "15", "height": "9", "type": "rubedoll", diff --git a/app/Game/Core/GameObjects/Item.js b/app/Game/Core/GameObjects/Item.js index 0662ee4..893f2c8 100644 --- a/app/Game/Core/GameObjects/Item.js +++ b/app/Game/Core/GameObjects/Item.js @@ -128,8 +128,8 @@ function (Parent, Box2D, Options, Settings, Exception, Nc, Assert) { handPosition.y ); this.body.SetPosition(position); - this.flip(direction); this.body.SetAngle((this.options.grabAngle || 0.0) * direction); + this.flip(direction); }; Item.prototype.getGrabPoint = function() { diff --git a/app/Game/Core/GameObjects/Items/RubeDoll.js b/app/Game/Core/GameObjects/Items/RubeDoll.js index 215a406..33a54ab 100644 --- a/app/Game/Core/GameObjects/Items/RubeDoll.js +++ b/app/Game/Core/GameObjects/Items/RubeDoll.js @@ -73,7 +73,7 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, Matrix, RubeDollJson) lower: this.joints[i].GetLowerLimit(), upper: this.joints[i].GetUpperLimit(), }; - +/* this.joints[i].EnableLimit(false); if(count < 4 && this.joints[i] instanceof Box2D.Dynamics.Joints.b2RevoluteJoint) { @@ -82,6 +82,7 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, Matrix, RubeDollJson) body.GetWorld().DestroyJoint(this.joints[i]); } count++; + */ } }; @@ -92,39 +93,46 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, Matrix, RubeDollJson) }; RubeDoll.prototype.flip = function(direction) { + var oldFlipDirection = this.flipDirection; - //Parent.prototype.flip.call(this, direction); - /* + Parent.prototype.flip.call(this, direction); - for (var i in this.joints) { - var joint = this.joints[i]; - var limits = this.limits[i]; + if(oldFlipDirection != direction) { - if (joint instanceof Box2D.Dynamics.Joints.b2RevoluteJoint) { + for (var i in this.joints) { + var joint = this.joints[i]; + var limits = this.limits[i]; - if (direction > 0) { - joint.SetLimits(limits.lower, limits.upper); - continue; - } + if (joint instanceof Box2D.Dynamics.Joints.b2RevoluteJoint) { - var a1 = limits.lower * -1; - var a2 = limits.upper * -1; + if (direction > 0) { + joint.SetLimits(limits.lower, limits.upper); + continue; + } - if (a2 > a1) { - joint.SetLimits(a1, a2); - } else { - joint.SetLimits(a2, a1); + var a1 = limits.lower * -1; + var a2 = limits.upper * -1; + + if (a2 > a1) { + joint.SetLimits(a1, a2); + } else { + joint.SetLimits(a2, a1); + } + + // joint.SetAngle(joint.GetAngle() * -1); } } - }*/ + } }; RubeDoll.prototype.reposition = function(handPosition, direction) { - console.log('repo'); - var oldPosition = this.getPosition(); var oldAngle = this.body.GetAngle(); + var oldDirection = this.flipDirection; + + // calls flip() at the end of Parent reposition() Parent.prototype.reposition.call(this, handPosition, direction); + var differenceAngle = oldAngle - this.body.GetAngle(); //this.body.SetLinearVelocity(new Box2D.Common.Math.b2Vec2(0, 0)); @@ -154,7 +162,8 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, Matrix, RubeDollJson) limb.SetPosition(globalPoint); // relative limb rotating by chest rotation difference - limb.SetAngle(limb.GetAngle() - differenceAngle); + var d = (oldDirection == direction) ? -1 : 1; + limb.SetAngle((limb.GetAngle() - differenceAngle) * d); //limb.SetType(Box2D.Dynamics.b2Body.b2_staticBody); //limb.SetLinearVelocity(new Box2D.Common.Math.b2Vec2(0, 0)); diff --git a/static/maps/tiled/debug.json b/static/maps/tiled/debug.json index 9a065a2..120737a 100644 --- a/static/maps/tiled/debug.json +++ b/static/maps/tiled/debug.json @@ -215,7 +215,7 @@ { "height":0, "id":10, - "name":"Small Cleaver", + "name":"RubeDoll", "properties": { From 502cf72a7e51d4682194ecca2b9fde7881ef21da Mon Sep 17 00:00:00 2001 From: logsol Date: Sun, 28 Aug 2016 13:24:27 +0200 Subject: [PATCH 44/68] fixes #157 --- app/Game/Client/View/Pixi/Layers/Ghost.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Game/Client/View/Pixi/Layers/Ghost.js b/app/Game/Client/View/Pixi/Layers/Ghost.js index f45635d..9377e59 100644 --- a/app/Game/Client/View/Pixi/Layers/Ghost.js +++ b/app/Game/Client/View/Pixi/Layers/Ghost.js @@ -36,10 +36,10 @@ function (Parent, PIXI, Nc, Settings) { arrow.visible = false; this.container.addChild(arrow); - var width = 12, - height = 12; + var width = 10, + height = 10; - arrow.beginFill(0xffffff, 0.1); + arrow.beginFill(0xffffff, 0.4); arrow.lineStyle(0, 0x000000); arrow.moveTo(0, 0); arrow.lineTo(width, 0); @@ -56,7 +56,7 @@ function (Parent, PIXI, Nc, Settings) { Ghost.prototype.onUpdatePlayerArrow = function(arrow, options) { var offsetX = 0, - offsetY = -60, + offsetY = -55, x = offsetX + options.x, y = offsetY + options.y; From c87997c774ec6e1999d268ab36712ecf5a528b95 Mon Sep 17 00:00:00 2001 From: logsol Date: Sun, 28 Aug 2016 22:40:25 +0200 Subject: [PATCH 45/68] fixes #147, fixes #136, is related to but doesnt entirely complete #144 --- app/Game/Channel/Channel.js | 1 + app/Game/Channel/GameController.js | 9 ++++ app/Game/Client/Control/PlayerController.js | 36 ++++++++++------ app/Game/Client/GameController.js | 15 +++++++ app/Game/Client/Networker.js | 4 +- app/Game/Client/View/Pixi/GameStats.js | 9 ++-- app/Game/Client/View/Pixi/Layer.js | 7 +++ app/Game/Client/View/Pixi/View.js | 47 +++++++++++++++++++-- app/Game/Config/Settings.js | 6 +-- app/Game/Core/Control/PlayerController.js | 14 ++++++ app/Game/Core/Player.js | 4 ++ app/Menu/Menu.js | 5 ++- static/html/index.html | 4 +- 13 files changed, 134 insertions(+), 27 deletions(-) diff --git a/app/Game/Channel/Channel.js b/app/Game/Channel/Channel.js index c4d6287..856ba8a 100755 --- a/app/Game/Channel/Channel.js +++ b/app/Game/Channel/Channel.js @@ -82,6 +82,7 @@ Channel.prototype.onEndRound = function() { var self = this; + this.gameController.endRound(); this.broadcastControlCommand("endRound", true); console.checkpoint("End Round (" + this.name + ") - Begin Round in " + Settings.CHANNEL_END_ROUND_TIME + " seconds"); diff --git a/app/Game/Channel/GameController.js b/app/Game/Channel/GameController.js index 001537f..318ffe8 100755 --- a/app/Game/Channel/GameController.js +++ b/app/Game/Channel/GameController.js @@ -21,6 +21,7 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N this.animationTimeout = null; this.worldUpdateTimeout = null; this.spawnTimeouts = []; + this.roundHasEnded = false; Parent.call(this, options); @@ -214,6 +215,14 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N this.spawnPlayer(player, 0); }; + GameController.prototype.endRound = function() { + this.roundHasEnded = true; + + for(var id in this.players) { + this.players[id].getPlayerController().setIsInBetweenGames(true); + } + }; + // FIXME: remove this method GameController.prototype.onResetLevel = function(userId) { diff --git a/app/Game/Client/Control/PlayerController.js b/app/Game/Client/Control/PlayerController.js index 02a9d92..80db229 100755 --- a/app/Game/Client/Control/PlayerController.js +++ b/app/Game/Client/Control/PlayerController.js @@ -27,76 +27,86 @@ function (Parent, Nc, KeyboardAndMouse, Gamepad, PointerLockManager) { }; PlayerController.prototype.moveLeft = function () { - if (!PointerLockManager.isLocked()) return; + if (!this.isPlayerInputAllowed()) return; Parent.prototype.moveLeft.call(this); Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'moveLeft'); } PlayerController.prototype.moveRight = function () { - if (!PointerLockManager.isLocked()) return; + if (!this.isPlayerInputAllowed()) return; Parent.prototype.moveRight.call(this); Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'moveRight'); } + // always allow to stop, to prevent endless running PlayerController.prototype.stop = function () { Parent.prototype.stop.call(this); Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'stop'); } PlayerController.prototype.jump = function () { - if (!PointerLockManager.isLocked()) return; + if (!this.isPlayerInputAllowed()) return; Parent.prototype.jump.call(this); Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'jump'); } + // always allow to stop. PlayerController.prototype.jumpStop = function () { - if (!PointerLockManager.isLocked()) return; Parent.prototype.jumpStop.call(this); Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'jumpStop'); } PlayerController.prototype.setXY = function(x, y) { - if (!PointerLockManager.isLocked()) return; + if (!this.isPlayerInputAllowed()) return; var options = {x:x, y:y}; Parent.prototype.lookAt.call(this, options); Nc.trigger(Nc.ns.client.to.server.gameCommand.send, 'lookAt', options); }; PlayerController.prototype.suicide = function() { - if (!PointerLockManager.isLocked()) return; + if (!this.isPlayerInputAllowed()) return; Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "suicide"); }; PlayerController.prototype.handActionRequest = function(options) { - if (!PointerLockManager.isLocked()) return; + if (!this.isPlayerInputAllowed()) return; Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "handActionRequest", options); }; PlayerController.prototype.showInfo = function() { - if (!PointerLockManager.isLocked()) return; + if (!this.isPlayerInputAllowed()) return; Nc.trigger(Nc.ns.client.game.gameStats.toggle, true); }; PlayerController.prototype.hideInfo = function() { - if (!PointerLockManager.isLocked()) return; + if (!this.isPlayerInputAllowed()) return; Nc.trigger(Nc.ns.client.game.gameStats.toggle, false); }; PlayerController.prototype.zoomIn = function() { - if (!PointerLockManager.isLocked()) return; + if (!this.isPlayerInputAllowed()) return; Nc.trigger(Nc.ns.client.game.zoomIn, true); }; PlayerController.prototype.zoomOut = function() { - if (!PointerLockManager.isLocked()) return; + if (!this.isPlayerInputAllowed()) return; Nc.trigger(Nc.ns.client.game.zoomOut, false); }; PlayerController.prototype.zoomReset = function() { - if (!PointerLockManager.isLocked()) return; + if (!this.isPlayerInputAllowed()) return; Nc.trigger(Nc.ns.client.game.zoomReset, false); }; - + /* + * Client overwrite - allow player input if PointerLock is locked to canvas + * and is not in between games + */ + PlayerController.prototype.isPlayerInputAllowed = function() { + return PointerLockManager.isLocked() + && Parent.prototype.isPlayerInputAllowed.call(this); + }; + + return PlayerController; }); \ No newline at end of file diff --git a/app/Game/Client/GameController.js b/app/Game/Client/GameController.js index 39e7eb4..2651130 100755 --- a/app/Game/Client/GameController.js +++ b/app/Game/Client/GameController.js @@ -130,6 +130,10 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque }; */ + GameController.prototype.onRemoveGameObject = function(options) { + + }; + GameController.prototype.updateGameObject = function (gameObject, gameObjectUpdate) { if(gameObject === this.me.doll) { this.me.setLastServerPositionState(gameObjectUpdate); @@ -252,6 +256,17 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque Nc.trigger(Nc.ns.client.view.gameStats.toggle, show); }; + GameController.prototype.beginRound = function() { + if (this.me.getPlayerController()) { + this.me.getPlayerController().setIsInBetweenGames(false); + } + }; + + GameController.prototype.endRound = function() { + this.me.getPlayerController().setIsInBetweenGames(true); + this.toggleGameStats(true); + }; + GameController.prototype.destroy = function() { if (!window.cancelAnimationFrame) { diff --git a/app/Game/Client/Networker.js b/app/Game/Client/Networker.js index a63582f..e74cbc9 100755 --- a/app/Game/Client/Networker.js +++ b/app/Game/Client/Networker.js @@ -196,10 +196,12 @@ function (ProtocolHelper, GameController, User, Nc, Settings, DomController) { this.gameController.createPlayer(this.users[userId]); } } + + this.gameController.beginRound(); }; Networker.prototype.onEndRound = function() { - this.gameController.toggleGameStats(true); + this.gameController.endRound(); }; return Networker; diff --git a/app/Game/Client/View/Pixi/GameStats.js b/app/Game/Client/View/Pixi/GameStats.js index d1842e0..e660d9c 100644 --- a/app/Game/Client/View/Pixi/GameStats.js +++ b/app/Game/Client/View/Pixi/GameStats.js @@ -9,7 +9,7 @@ function (PIXI, Nc, Settings, ColorConverter) { "use strict"; - function GameStats(gameContainer) { + function GameStats(view) { this.style = { borderWidth: 3, @@ -27,7 +27,7 @@ function (PIXI, Nc, Settings, ColorConverter) { fontSize: 12 }; - this.gameContainer = gameContainer; + this.view = view; this.container = new PIXI.DisplayObjectContainer(); @@ -77,11 +77,12 @@ function (PIXI, Nc, Settings, ColorConverter) { this.redraw(); // show stats with filters this.container.visible = true; - this.gameContainer.filters = this.filters; + + this.view.addFilters(this.filters); this.filters.forEach(function(filter) { filter.dirty = true; }); } else { this.container.visible = false; - this.gameContainer.filters = null; + this.view.removeFilters(this.filters); } } diff --git a/app/Game/Client/View/Pixi/Layer.js b/app/Game/Client/View/Pixi/Layer.js index 4d6465f..ae16ba5 100644 --- a/app/Game/Client/View/Pixi/Layer.js +++ b/app/Game/Client/View/Pixi/Layer.js @@ -174,6 +174,11 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings, ColorConverter, Nc) { Layer.prototype.addFilter = function(mesh, filterName, options) { + // use game container if mesh null + if(mesh === null) { + + } + if (!this.getAvailableMeshFilters().hasOwnProperty(filterName)) { throw new Exception('Filter ' + filterName + ' is not available'); } @@ -228,6 +233,8 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings, ColorConverter, Nc) { return; } + // FIXME this should throw an error i think since "options" is not defined here + // maybe we never actually call this method? var MeshFilter = this.getAvailableMeshFilters()[options.filter]; filters = filters.filter(function(filter){ diff --git a/app/Game/Client/View/Pixi/View.js b/app/Game/Client/View/Pixi/View.js index 62c2fc5..355be34 100755 --- a/app/Game/Client/View/Pixi/View.js +++ b/app/Game/Client/View/Pixi/View.js @@ -82,7 +82,7 @@ function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, Layer this.initPointerLockView(); // Tab Overlay (not using layer manager, cause of filters) - this.gameStats = new GameStats(this.container); + this.gameStats = new GameStats(this); this.stage.addChild(this.gameStats.getInfoContainer()); this.ghostLayer = new Ghost(); @@ -143,7 +143,8 @@ function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, Layer if (!Settings.ENABLE_POINTER_LOCK_FILTER) return; if(isLocked) { - this.container.filters = null; + this.removeFilters(this.pointerLockFilters); + this.clickToEnable.visible = false; this.onZoomReset(); } else { @@ -159,7 +160,7 @@ function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, Layer strokeThickness: 6 * this.currentZoom }); - this.container.filters = this.pointerLockFilters; + this.addFilters(this.pointerLockFilters); this.pointerLockFilters.forEach(function(filter) { filter.dirty = true; }); this.clickToEnable.position = new PIXI.Point(Settings.STAGE_WIDTH / 2 - this.clickToEnable.width / 2, Settings.STAGE_HEIGHT / 2 - this.clickToEnable.height / 2) @@ -170,6 +171,46 @@ function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, Layer } }; + PixiView.prototype.removeFilters = function(filters) { + + if(this.container && this.container.filters && this.container.filters.length) { + for (var i = this.container.filters.length - 1; i >= 0; i--) { + + for (var j = filters.length - 1; j >= 0; j--) { + if (filters[j] === this.container.filters[i]) { + this.container.filters.splice(i, 1); + } + } + } + + // weird bug, filters.length cant be 0, must be set to null + if(this.container.filters.length < 1) { + this.container.filters = null; + } + } + + }; + + PixiView.prototype.addFilters = function(filters) { + if (filters.length < 1) return; + if (!this.container) { + return; + } + + if (!this.container.filters) { + /* + * slice does a copy, which is important here - + * otherwise this.pointerLockFilters will be manipulated too on remove. + */ + this.container.filters = filters.slice(); + return; + } + + for (var i = 0; i < filters.length; i++) { + this.container.filters.push(filters[i]); + } + }; + PixiView.prototype.calculateCenterPosition = function() { var target = this.me.getHeadPosition(); diff --git a/app/Game/Config/Settings.js b/app/Game/Config/Settings.js index 7c43411..4153843 100755 --- a/app/Game/Config/Settings.js +++ b/app/Game/Config/Settings.js @@ -39,7 +39,7 @@ function () { VIEW_CONTROLLER: 0 ? "Three" : "Pixi", ARROW_GLIDE: 30, // % of the way per frame SHOW_LAYER_INFO: false, - ENABLE_POINTER_LOCK_FILTER: false, + ENABLE_POINTER_LOCK_FILTER: true, // GAME PLAY WALK_SPEED: 4, @@ -88,8 +88,8 @@ function () { CHANNEL_MAX_USERS: 20, CHANNEL_DESTRUCTION_TIME: 0.5 * 60, CHANNEL_END_ROUND_TIME: 20, //10, - CHANNEL_DEFAULT_MAX_USERS: 40, - CHANNEL_DEFAULT_SCORE_LIMIT: 10, + CHANNEL_DEFAULT_MAX_USERS: 10, + CHANNEL_DEFAULT_SCORE_LIMIT: 1, CHANNEL_DEFAULT_LEVELS: ["debug"], CHANNEL_RECORD_SESSION: false, diff --git a/app/Game/Core/Control/PlayerController.js b/app/Game/Core/Control/PlayerController.js index 8915fc3..3550f80 100755 --- a/app/Game/Core/Control/PlayerController.js +++ b/app/Game/Core/Control/PlayerController.js @@ -10,14 +10,18 @@ function () { this._shift; this._isJumping; this._walkingDirectionStatus = 0; + + this.isInBetweenGames = false; } PlayerController.prototype.moveLeft = function () { + if(!this.isPlayerInputAllowed()) return; this.player.move(-1); this._walkingDirectionStatus = -1; } PlayerController.prototype.moveRight = function () { + if(!this.isPlayerInputAllowed()) return; this.player.move(1); this._walkingDirectionStatus = 1; } @@ -28,6 +32,7 @@ function () { } PlayerController.prototype.jump = function () { + if(!this.isPlayerInputAllowed()) return; this._isJumping = true; this.player.jump(); } @@ -37,9 +42,18 @@ function () { } PlayerController.prototype.lookAt = function (options) { + if(!this.isPlayerInputAllowed()) return; if(options) this.player.lookAt(options.x, options.y); } + PlayerController.prototype.setIsInBetweenGames = function(isInBetweenGames) { + this.isInBetweenGames = !!isInBetweenGames; + }; + + PlayerController.prototype.isPlayerInputAllowed = function() { + return !this.isInBetweenGames; + }; + PlayerController.prototype.update = function () { if(this._walkingDirectionStatus != 0) { this.player.move(this._walkingDirectionStatus); diff --git a/app/Game/Core/Player.js b/app/Game/Core/Player.js index 025057c..bcca9db 100755 --- a/app/Game/Core/Player.js +++ b/app/Game/Core/Player.js @@ -187,5 +187,9 @@ function (Doll, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll this.playerController = playerController; } + Player.prototype.getPlayerController = function() { + return this.playerController; + } + return Player; }); diff --git a/app/Menu/Menu.js b/app/Menu/Menu.js index 5948d7f..e3dffd3 100644 --- a/app/Menu/Menu.js +++ b/app/Menu/Menu.js @@ -1,11 +1,12 @@ define([ + "Game/Config/Settings", "Lib/Utilities/ColorConverter", "Lib/Utilities/Exception", "Game/Client/PointerLockManager", "Lib/Utilities/QuerySelector" ], -function (ColorConverter, Exception, PointerLockManager, Qs) { +function (Settings, ColorConverter, Exception, PointerLockManager, Qs) { "use strict"; @@ -29,6 +30,8 @@ function (ColorConverter, Exception, PointerLockManager, Qs) { if(localStorage["customname"]) { Qs.$("#customname").value = localStorage["customname"]; } + Qs.$("#scoreLimit").value = Settings.CHANNEL_DEFAULT_SCORE_LIMIT; + Qs.$("#userLimit").value = Settings.CHANNEL_DEFAULT_MAX_USERS; Qs.$("#refresh").onclick = refresh; diff --git a/static/html/index.html b/static/html/index.html index fb062a7..f42bc8d 100644 --- a/static/html/index.html +++ b/static/html/index.html @@ -21,8 +21,8 @@

Create your own!

-

-

+

+

Maps
    From 8d8a55cc8c8e93563819b30966f2c05339a17c47 Mon Sep 17 00:00:00 2001 From: logsol Date: Mon, 29 Aug 2016 00:33:59 +0200 Subject: [PATCH 46/68] adds core analyzer script which generates the core/channel/client method overview of a class --- scripts/core_analyzer.js | 247 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 247 insertions(+) create mode 100644 scripts/core_analyzer.js diff --git a/scripts/core_analyzer.js b/scripts/core_analyzer.js new file mode 100644 index 0000000..3885d12 --- /dev/null +++ b/scripts/core_analyzer.js @@ -0,0 +1,247 @@ +/* + * This will generate a core/channel/client overview of a class + * + * usage: + * node scripts/core_analyzer.js [relative/path/class.js] -> relative path from core/client/channel split + * + * example: + * node scripts/core_analyzer.js GameObjects/Item.js + * + * example result: + * + * | CHANNEL | CORE | CLIENT + * |---------------------------------------|---------------------------------------|-------------------------------- + * | | getBodyDef | + * | | getFixtureDef | + * | | createFixture | + * | | flip | flip + * | beingGrabbed | beingGrabbed | + * | beingReleased | beingReleased | + * | onCollisionChange | onCollisionChange | + * | | reposition | + * | | getGrabPoint | + * | | throw | + * | | accelerateBody | + * | | destroy | destroy + * | | | createMesh + * | | | render + * | getLastMovedBy | | + * | setLastMovedBy | | + * | isGrabbingAllowed | | + * | isReleasingAllowed | | + * + */ + +var fs = require('fs'); +var util = require('util'); +var esprima = require('esprima'); +var escodegen = require('escodegen'); + +var info = []; +var overview = {}; + +var generatorOption = { + format: { + indent: { + style: ' ', + base: 0, + adjustMultilineComment: true//false + }, + newline: '\n', + space: ' ', + json: false, + renumber: false, + hexadecimal: false, + quotes: 'single', + escapeless: false, + compact: false, + parentheses: true, + semicolons: true, + safeConcatenation: true + }, + moz: { + starlessGenerator: false, + parenthesizedComprehensionBlock: false, + comprehensionExpressionStartsWithAssignment: false + }, + parse: null, + comment: true, + sourceMap: undefined, + sourceMapRoot: null, + sourceMapWithCode: false, + file: undefined, + directive: false, + verbatim: undefined +}; + +function readFile (path, category, fileName) { + //console.log("+++++ " + moduleName + " ++++++"); + var contents = fs.readFileSync(path + "/" + category + "/" + fileName); + contents = contents.toString(); + + getMethods(path, fileName, contents, category); +} + +function getMethods (path, fileName, contents, category) { + + category = category.toLowerCase(); + + overview[category] = []; + + var fullPath = path + "/" + fileName; + var moduleName = fileName.split(".js").join(""); + var tree = esprima.parse(contents); + + // find moduleId from return statement on module level + var module = tree.body[0].expression.arguments[1].body.body; + var moduleId = findModuleId(module); + + if (!moduleId) { + info.push("could not find moduleId in: " + fullPath); + return; + } + + if (moduleId == "Parent") { + info.push("not optimizing empty module (returning Parent) in: " + fullPath); + return; + } + + // find constructor + var constructorPosition = findConstructorPosition(module, moduleId); + if (constructorPosition === false) { + info.push("could not find constructor in: " + fileName) + return; + } + var constructor = module[constructorPosition]; + + + + for (var j = 0; j < module.length; j++) { + var expression = module[j]; + + if (expression.type == "ExpressionStatement") { + if(expression.expression && expression.expression.right) { + if(expression.expression.right.type == "FunctionExpression") { + overview[category].push(expression.expression.left.property.name); + } + } + } + } + + //console.log(escodegen.generate(tree, generatorOption)); +} + +function findModuleId (module) { + var moduleId = false; + for (var j = 0; j < module.length; j++) { + var expression = module[j]; + + //console.log(util.inspect(expression, { showHidden: true, depth: 4 })); + + if (expression.type == "ReturnStatement") { + + if(expression.argument.type == "Identifier") { + + // for return Module; + moduleId = expression.argument.name; + break; + + } else if (expression.argument.type == "NewExpression") { + + // for return new Module; + moduleId = expression.argument.callee.name; + break; + + } else { + info.push("Unexpected return type at module level. " + fullPath) + } + } + } + return moduleId; +}; + +function findConstructorPosition (module, moduleId) { + + for (var j = 0; j < module.length; j++) { + var expression = module[j]; + + if (expression.type == "FunctionDeclaration" && expression.id.name == moduleId) { + return j; + } + } + return false; +} + + +var superOverview = {}; +function display (category) { + + var all = ["core", "client", "channel"]; + var removeIndex = all.indexOf(category); + all.splice(removeIndex, 1); + + for (var k in overview[category]) { + + var name = overview[category][k]; + + if(superOverview.hasOwnProperty(name)) { + continue; + } + + var first = all[0]; + var second = all[1]; + + fv = 0 + (overview[first].indexOf(name) !== -1); + sv = 0 + (overview[second].indexOf(name) !== -1); + + superOverview[name] = {}; + + superOverview[name][category] = 1; + superOverview[name][first] = fv; + superOverview[name][second] = sv; + superOverview[name]['count'] = 1 + fv + sv; + } +} + +function show(){ + var alle = ['channel', 'core', 'client']; + console.log("| CHANNEL | CORE | CLIENT"); + console.log("|---------------------------------------|---------------------------------------|--------------------------------"); + for (var method in superOverview) { + var line = ""; + + for (var i = 0; i < alle.length; i++) { + if (superOverview[method] && superOverview[method].hasOwnProperty(alle[i])) { + + line += "| " ; + + if(superOverview[method][alle[i]] === 1) { + line += method; + line += Array(39 - method.length).join(" "); + } else { + line += Array(39).join(" "); + } + + + } else { + + } + + } + console.log(line) + } +} + + + +readFile("app/Game", "Core", process.argv[2]); +readFile("app/Game", "Channel", process.argv[2]); +readFile("app/Game", "Client", process.argv[2]); + +display("core") +display("client") +display("channel") + +console.log("\n") +show() +console.log("\n") \ No newline at end of file From fc7866f11ed168efff1ef599825dc9da3a3d9e10 Mon Sep 17 00:00:00 2001 From: logsol Date: Sat, 1 Oct 2016 12:11:27 +0200 Subject: [PATCH 47/68] Hides playercontroller within player In order to not provide deep exposure to PlayerController, we refactored it so that it is not visible anymore outside Player. Also we renamed isInBetweenGames to inBetweenRounds. Moved creation of PlayerController from GameController(s) to The channel Player and client Me. --- app/Game/Channel/GameController.js | 6 ++---- app/Game/Channel/Player.js | 7 +++++-- app/Game/Client/GameController.js | 7 ++----- app/Game/Client/Me.js | 6 ++++-- app/Game/Client/Player.js | 2 +- app/Game/Core/Control/PlayerController.js | 8 ++++---- app/Game/Core/Player.js | 15 ++++++--------- 7 files changed, 24 insertions(+), 27 deletions(-) diff --git a/app/Game/Channel/GameController.js b/app/Game/Channel/GameController.js index 318ffe8..4d0adbd 100755 --- a/app/Game/Channel/GameController.js +++ b/app/Game/Channel/GameController.js @@ -2,7 +2,6 @@ define([ "Game/Core/GameController", "Game/Channel/Physics/Engine", "Game/Config/Settings", - "Game/Channel/Control/PlayerController", "Lib/Utilities/RequestAnimFrame", "Lib/Utilities/NotificationCenter", "Lib/Vendor/Box2D", @@ -12,7 +11,7 @@ define([ "Game/Channel/GameObjects/Items/RubeDoll" ], -function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, Nc, Box2D, Player, GameObject, Doll, RubeDoll) { +function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player, GameObject, Doll, RubeDoll) { "use strict"; @@ -62,7 +61,6 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N GameController.prototype.createPlayer = function(user) { var player = Parent.prototype.createPlayer.call(this, user); - player.setPlayerController(new PlayerController(player)) user.setPlayer(player); }; @@ -219,7 +217,7 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N this.roundHasEnded = true; for(var id in this.players) { - this.players[id].getPlayerController().setIsInBetweenGames(true); + this.players[id].setInBetweenRounds(true); } }; diff --git a/app/Game/Channel/Player.js b/app/Game/Channel/Player.js index eb0bf2b..6f3771c 100755 --- a/app/Game/Channel/Player.js +++ b/app/Game/Channel/Player.js @@ -1,14 +1,17 @@ define([ "Game/Core/Player", - "Lib/Utilities/NotificationCenter" + "Lib/Utilities/NotificationCenter", + "Game/Channel/Control/PlayerController" ], -function (Parent, Nc) { +function (Parent, Nc, PlayerController) { "use strict"; function Player(id, physicsEngine, user) { Parent.call(this, id, physicsEngine, user); + + this.playerController = new PlayerController(this); } Player.prototype = Object.create(Parent.prototype); diff --git a/app/Game/Client/GameController.js b/app/Game/Client/GameController.js index 2651130..0ae5778 100755 --- a/app/Game/Client/GameController.js +++ b/app/Game/Client/GameController.js @@ -151,7 +151,6 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque }; GameController.prototype.setMe = function() { - this.me.setPlayerController(new PlayerController(this.me)); this.view.setMe(this.me); }; @@ -257,13 +256,11 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque }; GameController.prototype.beginRound = function() { - if (this.me.getPlayerController()) { - this.me.getPlayerController().setIsInBetweenGames(false); - } + this.me.setInBetweenRounds(false); }; GameController.prototype.endRound = function() { - this.me.getPlayerController().setIsInBetweenGames(true); + this.me.setInBetweenRounds(true); this.toggleGameStats(true); }; diff --git a/app/Game/Client/Me.js b/app/Game/Client/Me.js index 64d1e2f..f271f03 100644 --- a/app/Game/Client/Me.js +++ b/app/Game/Client/Me.js @@ -2,10 +2,11 @@ define([ "Game/Client/Player", "Game/Config/Settings", "Lib/Utilities/NotificationCenter", - "Lib/Utilities/Assert" + "Lib/Utilities/Assert", + "Game/Client/Control/PlayerController", ], -function (Parent, Settings, Nc, Assert) { +function (Parent, Settings, Nc, Assert, PlayerController) { "use strict"; @@ -27,6 +28,7 @@ function (Parent, Settings, Nc, Assert) { this.arrowMesh = null; this.createAndAddArrow(); + this.playerController = new PlayerController(this); } Me.prototype = Object.create(Parent.prototype); diff --git a/app/Game/Client/Player.js b/app/Game/Client/Player.js index 6f511ac..4ad6bac 100755 --- a/app/Game/Client/Player.js +++ b/app/Game/Client/Player.js @@ -8,7 +8,7 @@ function (Parent, Nc, Settings) { "use strict"; - function Player(id, physicsEngine, user) { + function Player(id, physicsEngine, user, isMe) { Parent.call(this, id, physicsEngine, user); this.healthBarView = null; diff --git a/app/Game/Core/Control/PlayerController.js b/app/Game/Core/Control/PlayerController.js index 3550f80..9286f4c 100755 --- a/app/Game/Core/Control/PlayerController.js +++ b/app/Game/Core/Control/PlayerController.js @@ -11,7 +11,7 @@ function () { this._isJumping; this._walkingDirectionStatus = 0; - this.isInBetweenGames = false; + this.inBetweenRounds = false; } PlayerController.prototype.moveLeft = function () { @@ -46,12 +46,12 @@ function () { if(options) this.player.lookAt(options.x, options.y); } - PlayerController.prototype.setIsInBetweenGames = function(isInBetweenGames) { - this.isInBetweenGames = !!isInBetweenGames; + PlayerController.prototype.setInBetweenRounds = function(inBetweenRounds) { + this.inBetweenRounds = !!inBetweenRounds; }; PlayerController.prototype.isPlayerInputAllowed = function() { - return !this.isInBetweenGames; + return !this.inBetweenRounds; }; PlayerController.prototype.update = function () { diff --git a/app/Game/Core/Player.js b/app/Game/Core/Player.js index bcca9db..49f3d28 100755 --- a/app/Game/Core/Player.js +++ b/app/Game/Core/Player.js @@ -1,5 +1,6 @@ define([ "Game/" + GLOBALS.context + "/GameObjects/Doll", + "Game/" + GLOBALS.context + "/Control/PlayerController", "Game/Config/Settings", "Lib/Utilities/NotificationCenter", "Lib/Utilities/Exception", @@ -8,7 +9,7 @@ define([ "Game/" + GLOBALS.context + "/GameObjects/Items/RubeDoll" ], -function (Doll, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll) { +function (Doll, PlayerController, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll) { "use strict"; @@ -21,7 +22,7 @@ function (Doll, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll this.user = user; this.physicsEngine = physicsEngine; - this.playerController = null; + this.playerController = null; // pre-initialise with null, because client/players don't get one this.doll; this.id = id; this.spawned = false; @@ -183,13 +184,9 @@ function (Doll, Settings, Nc, Exception, ColorConverter, SpectatorDoll, RubeDoll } } - Player.prototype.setPlayerController = function(playerController) { - this.playerController = playerController; - } - - Player.prototype.getPlayerController = function() { - return this.playerController; - } + Player.prototype.setInBetweenRounds = function(inBetweenRounds) { + return this.playerController.setInBetweenRounds(inBetweenRounds); + }; return Player; }); From a5f828a8616beb4feaa5f9332a2d40fabafc2b14 Mon Sep 17 00:00:00 2001 From: logsol Date: Sat, 1 Oct 2016 13:43:37 +0200 Subject: [PATCH 48/68] Adds NETWORK_LOG_FILTER setting to incoming network messages --- app/Game/Client/Networker.js | 43 +++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/app/Game/Client/Networker.js b/app/Game/Client/Networker.js index e74cbc9..9d35cba 100755 --- a/app/Game/Client/Networker.js +++ b/app/Game/Client/Networker.js @@ -25,13 +25,25 @@ function (ProtocolHelper, GameController, User, Nc, Settings, DomController) { var self = this; this.socketLink.on('message', function (message) { var m = JSON.parse(message) - if(Settings.NETWORK_LOG_INCOMING) { - if (message.indexOf('worldUpdate') == -1 && message.indexOf('pong') == -1) { + if(Settings.NETWORK_LOG_INCOMING) { + var shouldBeFiltered = false; + var keyword; + + for (var i = 0; i < Settings.NETWORK_LOG_FILTER.length; i++) { + keyword = Settings.NETWORK_LOG_FILTER[i]; + if(message.search(keyword) != -1) { + shouldBeFiltered = true; + break; + } + }; + + if(!shouldBeFiltered) { console.log('INCOMING', message); } - } + + ProtocolHelper.applyCommand(message, self); }); @@ -117,23 +129,18 @@ function (ProtocolHelper, GameController, User, Nc, Settings, DomController) { this.socketLink.send(message); if(Settings.NETWORK_LOG_OUTGOING) { - if(Settings.NETWORK_LOG_FILTER.length > 0) { + var shouldBeFiltered = false; + var keyword; - var shouldBeFiltered = false; - var keyword; - - for (var i = 0; i < Settings.NETWORK_LOG_FILTER.length; i++) { - keyword = Settings.NETWORK_LOG_FILTER[i]; - if(message.search(keyword) != -1) { - shouldBeFiltered = true; - break; - } - }; - - if(!shouldBeFiltered) { - console.log('OUTGOING', message); + for (var i = 0; i < Settings.NETWORK_LOG_FILTER.length; i++) { + keyword = Settings.NETWORK_LOG_FILTER[i]; + if(message.search(keyword) != -1) { + shouldBeFiltered = true; + break; } - } else { + }; + + if(!shouldBeFiltered) { console.log('OUTGOING', message); } } From 016c48ec3b6f2869bc0045816e28270b4c82e1fb Mon Sep 17 00:00:00 2001 From: logsol Date: Sat, 1 Oct 2016 14:01:12 +0200 Subject: [PATCH 49/68] During first worldUpdate set doll positions after spawning players Otherwise we get a warning. --- app/Game/Client/GameController.js | 8 ++++---- app/Game/Core/GameController.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Game/Client/GameController.js b/app/Game/Client/GameController.js index 0ae5778..8671e6f 100755 --- a/app/Game/Client/GameController.js +++ b/app/Game/Client/GameController.js @@ -78,10 +78,6 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque GameController.prototype.onClientReadyResponse = function(options) { var i; - if (options.worldUpdate) { - this.onWorldUpdate(options.worldUpdate); - } - if (options.runtimeItems) { for (i = 0; i < options.runtimeItems.length; i++) { @@ -107,6 +103,10 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque } } + if (options.worldUpdate) { // needs to stay after onSpawnPlayer otherwise others doll will not be there + this.onWorldUpdate(options.worldUpdate); + } + //this.audioPlayer = new AudioPlayer(Settings.AUDIO_PATH + "city.mp3"); //this.audioPlayer.play(); }; diff --git a/app/Game/Core/GameController.js b/app/Game/Core/GameController.js index 04a4c6d..6210320 100755 --- a/app/Game/Core/GameController.js +++ b/app/Game/Core/GameController.js @@ -75,7 +75,7 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert) var gameObject = this.worldUpdateObjects[uid]; if (!(gameObject instanceof GameObject)) { - console.warn('Cant find object ' + uid + ' in worldUpdateObjects pool'); + console.warn('Can\'t find object ' + uid + ' in worldUpdateObjects pool:', Object.keys(this.worldUpdateObjects)); continue; } From 8b8093b7713479b519c03768ef914cb8f1c99bc9 Mon Sep 17 00:00:00 2001 From: logsol Date: Sat, 1 Oct 2016 16:08:01 +0200 Subject: [PATCH 50/68] Stops sending gameCommands between beginRound and clientReady Listen for beginRound control command to set client to be unready again so it can load its new level without getting any gameCommands like worldUpdate --- app/Game/Channel/User.js | 10 ++++++++++ app/Game/Client/Networker.js | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/Game/Channel/User.js b/app/Game/Channel/User.js index 1bc4b60..d8fcd78 100755 --- a/app/Game/Channel/User.js +++ b/app/Game/Channel/User.js @@ -61,6 +61,16 @@ function(Parent, Nc, ProtocolHelper, ProtocolParser) { var recipient = this.id; var data = ProtocolHelper.encodeCommand(command, options); + /** + * Listen for beginRound control command + * to set client to be unready again + * so it can load its new level without getting + * any gameCommands like worldUpdate + */ + if(command == "beginRound") { + this.isReady = false; + } + Nc.trigger(Nc.ns.channel.to.server.controlCommand.send, recipient, data); }; diff --git a/app/Game/Client/Networker.js b/app/Game/Client/Networker.js index 9d35cba..fabdc3b 100755 --- a/app/Game/Client/Networker.js +++ b/app/Game/Client/Networker.js @@ -191,7 +191,6 @@ function (ProtocolHelper, GameController, User, Nc, Settings, DomController) { if(this.gameController) { this.gameController.destroy(); - delete this.gameController; } this.gameController = new GameController(options); From 8641a2dc0b53f3424e08441a2513e5875d725337 Mon Sep 17 00:00:00 2001 From: logsol Date: Sat, 1 Oct 2016 16:44:40 +0200 Subject: [PATCH 51/68] On destroy unsubscribe missing GameObjects from render event fixes #71 --- app/Game/Channel/GameController.js | 42 ++++++++++++++++++++--------- app/Game/Client/GameObjects/Item.js | 4 ++- app/Game/Client/Player.js | 5 +++- static/html/index.html | 6 ----- 4 files changed, 36 insertions(+), 21 deletions(-) diff --git a/app/Game/Channel/GameController.js b/app/Game/Channel/GameController.js index 4d0adbd..c41897a 100755 --- a/app/Game/Channel/GameController.js +++ b/app/Game/Channel/GameController.js @@ -177,25 +177,36 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player, return spawnedPlayers; }; - GameController.prototype.getRuntimeItems = function() { - var objects = []; + GameController.prototype._getRuntimeItems = function() { - // This is using the level.createItem mechanism to - // create the RubeDoll from its ItemSettings + var runtimeItems = []; for (var uid in this.worldUpdateObjects) { if(this.worldUpdateObjects[uid] instanceof RubeDoll) { var object = this.worldUpdateObjects[uid]; - var options = object.options; - options.x = object.getPosition().x; - options.y = object.getPosition().y; - objects.push({ - uid: object.uid, - options: object.options - }); + runtimeItems.push(object); } } + return runtimeItems; + }; - return objects; + GameController.prototype.gatherRuntimeItemsForWorldUpdate = function() { + var infos = []; + var runtimeItems = this._getRuntimeItems(); + + // On the other side this is using the level.createItem mechanism to + // create the RubeDoll from its ItemSettings + for (var i = 0; i < runtimeItems.length; i++) { + var object = runtimeItems[i]; + var options = object.options; + options.x = object.getPosition().x; + options.y = object.getPosition().y; + infos.push({ + uid: object.uid, + options: object.options + }); + } + + return infos; }; GameController.prototype.onClientReady = function(userId) { @@ -204,7 +215,7 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player, var options = { spawnedPlayers: this.getSpawnedPlayersAndTheirPositions(), worldUpdate: this.getWorldUpdateObject(true), - runtimeItems: this.getRuntimeItems(), + runtimeItems: this.gatherRuntimeItemsForWorldUpdate(), userId: userId }; @@ -241,6 +252,11 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player, clearTimeout(this.spawnTimeouts[i]); }; + var runtimeItems = this._getRuntimeItems(); + for (var i = 0; i < runtimeItems.length; i++) { + runtimeItems[i].destroy(); + } + Parent.prototype.destroy.call(this); }; diff --git a/app/Game/Client/GameObjects/Item.js b/app/Game/Client/GameObjects/Item.js index 8115858..3770dce 100755 --- a/app/Game/Client/GameObjects/Item.js +++ b/app/Game/Client/GameObjects/Item.js @@ -13,7 +13,9 @@ function (Parent, Settings, Nc, Layer) { this.layerId = Layer.ID.ITEM; Parent.call(this, physicsEngine, uid, options); - Nc.on(Nc.ns.client.game.events.render, this.render, this); + this.ncTokens = this.ncTokens.concat([ + Nc.on(Nc.ns.client.game.events.render, this.render, this) + ]); } Item.prototype = Object.create(Parent.prototype); diff --git a/app/Game/Client/Player.js b/app/Game/Client/Player.js index 4ad6bac..0af2d58 100755 --- a/app/Game/Client/Player.js +++ b/app/Game/Client/Player.js @@ -16,7 +16,9 @@ function (Parent, Nc, Settings) { this.healthBarViewVisible = false; this.initHealthBar(); - Nc.on(Nc.ns.client.game.events.render, this.render, this); + this.ncTokens = [ + Nc.on(Nc.ns.client.game.events.render, this.render, this) + ]; } Player.prototype = Object.create(Parent.prototype); @@ -109,6 +111,7 @@ function (Parent, Nc, Settings) { Player.prototype.destroy = function() { clearTimeout(this.healthBarViewVisibleTimeout); Nc.trigger(Nc.ns.client.view.healthBar.remove, this.healthBarView); + Nc.off(this.ncTokens); Parent.prototype.destroy.call(this); }; diff --git a/static/html/index.html b/static/html/index.html index f42bc8d..47b486f 100644 --- a/static/html/index.html +++ b/static/html/index.html @@ -26,12 +26,6 @@
    Maps
      -
    • - -
    • -
    • - -
    From c0685929153c64887da1e459c883527e66e7ca8d Mon Sep 17 00:00:00 2001 From: logsol Date: Sat, 1 Oct 2016 19:09:52 +0200 Subject: [PATCH 52/68] Makes world in Engine private And some refactoring. --- app/Game/Core/GameObjects/GameObject.js | 2 +- app/Game/Core/Loader/Level.js | 1 + app/Game/Core/Physics/Engine.js | 23 ++++++++++------------- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/app/Game/Core/GameObjects/GameObject.js b/app/Game/Core/GameObjects/GameObject.js index c0f63e3..22d770d 100755 --- a/app/Game/Core/GameObjects/GameObject.js +++ b/app/Game/Core/GameObjects/GameObject.js @@ -14,7 +14,7 @@ function (Box2D, Exception, Assert, Nc) { var def = this.getBodyDef(); def.userData = this; - this.body = physicsEngine.getWorld().CreateBody(def); + this.body = physicsEngine.createBody(def); this.ncTokens = (this.ncTokens || []).concat([ Nc.on(Nc.ns.client.game.events.destroy, this.destroy, this) diff --git a/app/Game/Core/Loader/Level.js b/app/Game/Core/Loader/Level.js index bd49a20..86fd92b 100755 --- a/app/Game/Core/Loader/Level.js +++ b/app/Game/Core/Loader/Level.js @@ -25,6 +25,7 @@ define([ Level.prototype.load = function (uid) { var self = this; + // FIXME: check if theres a security hazard here (user injected path) var path = Settings.MAPS_PATH + uid + ".json"; this.loadLevelDataFromPath(path, function (levelData) { self.setup(levelData); diff --git a/app/Game/Core/Physics/Engine.js b/app/Game/Core/Physics/Engine.js index c47efc3..245b8f6 100755 --- a/app/Game/Core/Physics/Engine.js +++ b/app/Game/Core/Physics/Engine.js @@ -15,7 +15,6 @@ function (Settings, Box2D, CollisionDetector, Nc) { Settings.BOX2D_ALLOW_SLEEP ); this.world.SetWarmStarting(true); - this.ground = null; this.lastStep = Date.now(); this.worldQueue = []; @@ -24,24 +23,22 @@ function (Settings, Box2D, CollisionDetector, Nc) { ]; } - Engine.prototype.getWorld = function () { - return this.world; - } - - Engine.prototype.getGround = function () { - return this.ground; - } - Engine.prototype.setCollisionDetector = function () { var detector = new CollisionDetector(); this.world.SetContactListener(detector.getListener()); } + Engine.prototype.getWorldForRubeLoader = function() { + return this.world; + }; + Engine.prototype.createBody = function (bodyDef) { - var body = this.world.CreateBody(bodyDef); - if(!this.ground) this.ground = body; - return body; + return this.world.CreateBody(bodyDef); + } + + Engine.prototype.destroyBody = function (body) { + return this.world.DestroyBody(body); } Engine.prototype.addToWorldQueue = function(callback) { @@ -65,8 +62,8 @@ function (Settings, Box2D, CollisionDetector, Nc) { } Engine.prototype.destroy = function() { - delete this.world; Nc.offAll(this.ncTokens); + delete this.world; }; From 3a5af058ef59f19e6759c7fc0aecfbf38c94d5d7 Mon Sep 17 00:00:00 2001 From: logsol Date: Sat, 1 Oct 2016 19:12:52 +0200 Subject: [PATCH 53/68] Prevents adding damage after round has ended Because it created double round endings, which led to crashes. Also moved inBetweenRound state from PlayerController to GameController. --- app/Game/Channel/GameController.js | 10 +++++++++- app/Game/Channel/Player.js | 11 ++++++++--- app/Game/Client/Player.js | 4 ++-- app/Game/Core/Control/PlayerController.js | 15 +++++---------- app/Game/Core/GameController.js | 7 ++----- app/Game/Core/GameObjects/Items/RubeDoll.js | 5 ++--- app/Game/Core/Player.js | 10 ++++++++-- 7 files changed, 36 insertions(+), 26 deletions(-) diff --git a/app/Game/Channel/GameController.js b/app/Game/Channel/GameController.js index c41897a..69f04dd 100755 --- a/app/Game/Channel/GameController.js +++ b/app/Game/Channel/GameController.js @@ -60,7 +60,11 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player, } GameController.prototype.createPlayer = function(user) { - var player = Parent.prototype.createPlayer.call(this, user); + + var revealedGameController = { + isInBetweenRounds: this.isInBetweenRounds.bind(this) + }; + var player = Parent.prototype.createPlayer.call(this, user, revealedGameController); user.setPlayer(player); }; @@ -232,6 +236,10 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player, } }; + GameController.prototype.isInBetweenRounds = function() { + return this.roundHasEnded; + }; + // FIXME: remove this method GameController.prototype.onResetLevel = function(userId) { diff --git a/app/Game/Channel/Player.js b/app/Game/Channel/Player.js index 6f3771c..e4f5846 100755 --- a/app/Game/Channel/Player.js +++ b/app/Game/Channel/Player.js @@ -8,8 +8,8 @@ function (Parent, Nc, PlayerController) { "use strict"; - function Player(id, physicsEngine, user) { - Parent.call(this, id, physicsEngine, user); + function Player(id, physicsEngine, user, revealedGameController) { + Parent.call(this, id, physicsEngine, user, revealedGameController); this.playerController = new PlayerController(this); } @@ -64,6 +64,12 @@ function (Parent, Nc, PlayerController) { }; Player.prototype.addDamage = function(damage, enemy, byItem) { + + // Prevent stats change (kills) after round has ended + if (this.revealedGameController.isInBetweenRounds()) { + return; + } + this.stats.health -= damage; if(this.stats.health < 0) this.stats.health = 0; @@ -118,7 +124,6 @@ function (Parent, Nc, PlayerController) { }); } }; - return Player; diff --git a/app/Game/Client/Player.js b/app/Game/Client/Player.js index 0af2d58..25d19c5 100755 --- a/app/Game/Client/Player.js +++ b/app/Game/Client/Player.js @@ -16,9 +16,9 @@ function (Parent, Nc, Settings) { this.healthBarViewVisible = false; this.initHealthBar(); - this.ncTokens = [ + this.ncTokens = (this.ncTokens || []).concat([ Nc.on(Nc.ns.client.game.events.render, this.render, this) - ]; + ]); } Player.prototype = Object.create(Parent.prototype); diff --git a/app/Game/Core/Control/PlayerController.js b/app/Game/Core/Control/PlayerController.js index 9286f4c..62b09db 100755 --- a/app/Game/Core/Control/PlayerController.js +++ b/app/Game/Core/Control/PlayerController.js @@ -10,8 +10,6 @@ function () { this._shift; this._isJumping; this._walkingDirectionStatus = 0; - - this.inBetweenRounds = false; } PlayerController.prototype.moveLeft = function () { @@ -46,20 +44,17 @@ function () { if(options) this.player.lookAt(options.x, options.y); } - PlayerController.prototype.setInBetweenRounds = function(inBetweenRounds) { - this.inBetweenRounds = !!inBetweenRounds; - }; - - PlayerController.prototype.isPlayerInputAllowed = function() { - return !this.inBetweenRounds; - }; - PlayerController.prototype.update = function () { if(this._walkingDirectionStatus != 0) { this.player.move(this._walkingDirectionStatus); } } + // Default behaviour - may be needed later? + PlayerController.prototype.isPlayerInputAllowed = function() { + return true; + }; + PlayerController.prototype.destroy = function() { // extend if necessary }; diff --git a/app/Game/Core/GameController.js b/app/Game/Core/GameController.js index 6210320..0450c42 100755 --- a/app/Game/Core/GameController.js +++ b/app/Game/Core/GameController.js @@ -111,8 +111,8 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert) delete this.players[userId]; }; - GameController.prototype.createPlayer = function(user) { - var player = new Player(user.id, this.physicsEngine, user); + GameController.prototype.createPlayer = function(user, revealedGameController) { + var player = new Player(user.id, this.physicsEngine, user, revealedGameController); this.players[user.id] = player; return player; }; @@ -132,8 +132,6 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert) }; GameController.prototype.destroy = function () { - var i = 0; - for(var player in this.players) { this.players[player].destroy(); } @@ -150,7 +148,6 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert) this.worldUpdateObjects = null; Nc.off(this.ncTokens); - }; return GameController; diff --git a/app/Game/Core/GameObjects/Items/RubeDoll.js b/app/Game/Core/GameObjects/Items/RubeDoll.js index 33a54ab..ba1f9cf 100644 --- a/app/Game/Core/GameObjects/Items/RubeDoll.js +++ b/app/Game/Core/GameObjects/Items/RubeDoll.js @@ -23,13 +23,12 @@ function (Parent, RubeLoader, Box2D, Settings, Assert, Nc, Matrix, RubeDollJson) this.limits = []; var chest = null; - var world = physicsEngine.getWorld(); - this.rubeLoader = new RubeLoader(RubeDollJson, world); + this.rubeLoader = new RubeLoader(RubeDollJson, physicsEngine.getWorldForRubeLoader()); this.loadRubeDollFromScene(options); Parent.call(this, physicsEngine, uid, options); - world.DestroyBody(this.body); + physicsEngine.destroyBody(this.body); this.body = this.limbs.chest; delete this.limbs.chest; diff --git a/app/Game/Core/Player.js b/app/Game/Core/Player.js index 49f3d28..9e73e4d 100755 --- a/app/Game/Core/Player.js +++ b/app/Game/Core/Player.js @@ -13,7 +13,7 @@ function (Doll, PlayerController, Settings, Nc, Exception, ColorConverter, Spect "use strict"; - function Player (id, physicsEngine, user) { + function Player (id, physicsEngine, user, revealedGameController) { this.stats = { health: 100, deaths: 0, @@ -27,7 +27,9 @@ function (Doll, PlayerController, Settings, Nc, Exception, ColorConverter, Spect this.id = id; this.spawned = false; this.holdingItem = null; + this.inBetweenRounds = true; this.spectatorDoll = new SpectatorDoll(this.physicsEngine, "spectatorDoll-" + this.id, this); + this.revealedGameController = revealedGameController; } Player.prototype.getNickname = function() { @@ -185,7 +187,11 @@ function (Doll, PlayerController, Settings, Nc, Exception, ColorConverter, Spect } Player.prototype.setInBetweenRounds = function(inBetweenRounds) { - return this.playerController.setInBetweenRounds(inBetweenRounds); + this.inBetweenRounds = inBetweenRounds; + }; + + Player.prototype.isInBetweenRounds = function() { + return this.inBetweenRounds; }; return Player; From dba743cd7b8248f459225e7194b5c40f7ba8abaa Mon Sep 17 00:00:00 2001 From: logsol Date: Sun, 9 Oct 2016 12:46:07 +0200 Subject: [PATCH 54/68] Updates obsolete/broken way of clearing fingerprints When a user leaves the channel, some items need to be cleared of their fingerprints (lastTouchedBy). This feature was broken because it used the this.gameObjects pool which was no longer in use. The channel GameController now triggers an event to which all items are subscribed to and if it is triggered, all items with that users fingerprints clear themselves off those. Fixes #170 --- app/Game/Channel/GameController.js | 11 ++++++++++- app/Game/Channel/GameObjects/Item.js | 16 ++++++++++++++-- app/Game/Client/GameController.js | 4 ---- app/Game/Core/GameController.js | 22 +--------------------- app/Lib/Utilities/NotificationCenter.js | 6 ++++-- 5 files changed, 29 insertions(+), 30 deletions(-) diff --git a/app/Game/Channel/GameController.js b/app/Game/Channel/GameController.js index 69f04dd..4e85302 100755 --- a/app/Game/Channel/GameController.js +++ b/app/Game/Channel/GameController.js @@ -36,7 +36,6 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player, console.checkpoint('starting game controller for channel (' + options.channelName + ')'); } - GameController.prototype = Object.create(Parent.prototype); GameController.prototype.update = function () { @@ -59,6 +58,16 @@ function (Parent, PhysicsEngine, Settings, requestAnimFrame, Nc, Box2D, Player, this.createPlayer(user); } + GameController.prototype.onUserLeft = function (userId) { + var player = this.players[userId]; + this.clearItemsOfPlayerFingerPrints(player); + Parent.prototype.onUserLeft.call(this, userId); + }; + + GameController.prototype.clearItemsOfPlayerFingerPrints = function(player) { + Nc.trigger(Nc.ns.channel.events.game.player.clearFingerPrints, player); + }; + GameController.prototype.createPlayer = function(user) { var revealedGameController = { diff --git a/app/Game/Channel/GameObjects/Item.js b/app/Game/Channel/GameObjects/Item.js index b28a0b5..c335182 100755 --- a/app/Game/Channel/GameObjects/Item.js +++ b/app/Game/Channel/GameObjects/Item.js @@ -1,8 +1,9 @@ define([ - "Game/Core/GameObjects/Item" + "Game/Core/GameObjects/Item", + "Lib/Utilities/NotificationCenter", ], -function (Parent) { +function (Parent, Nc) { "use strict"; @@ -10,6 +11,10 @@ function (Parent) { Parent.call(this, physicsEngine, uid, options); this.heldByPlayers = []; this.lastMoved = null; + + this.ncTokens = (this.ncTokens || []).concat([ + Nc.on(Nc.ns.channel.events.game.player.clearFingerPrints, this.clearOfPlayerFingerPrints, this) + ]); } Item.prototype = Object.create(Parent.prototype); @@ -59,6 +64,13 @@ function (Parent) { } }; + Item.prototype.clearOfPlayerFingerPrints = function(player) { + if (this.getLastMovedBy() && this.getLastMovedBy().player === player) { + console.checkpoint('Removing fingerprints from ' + this.options.image); + this.setLastMovedBy(null); + } + }; + Item.prototype.onCollisionChange = function(isColliding, fixture) { if(isColliding) { diff --git a/app/Game/Client/GameController.js b/app/Game/Client/GameController.js index 8671e6f..1447520 100755 --- a/app/Game/Client/GameController.js +++ b/app/Game/Client/GameController.js @@ -55,10 +55,6 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque this.mePositionStateOverride(); } - //for (var uid in this.gameObjects.animated) { - // this.gameObjects.animated[uid].render(); - //} - Nc.trigger(Nc.ns.client.game.events.render); this.view.render(); diff --git a/app/Game/Core/GameController.js b/app/Game/Core/GameController.js index 0450c42..58b4454 100755 --- a/app/Game/Core/GameController.js +++ b/app/Game/Core/GameController.js @@ -92,20 +92,12 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert) this.loadLevel(this.level.uid); }; - /* - GameController.prototype.userJoined = function (user) { - this.players[user.id] = this.createPlayer(user); - } - */ - GameController.prototype.onUserLeft = function (userId) { var player = this.players[userId]; if(!player) { console.warn("User (", userId ,") left who has not joined"); return; } - - this.clearItemsOfPlayerFingerPrints(player); player.destroy(); delete this.players[userId]; @@ -117,25 +109,13 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert) return player; }; - GameController.prototype.clearItemsOfPlayerFingerPrints = function(player) { - for (var key in this.gameObjects) { - for (var i = 0; i < this.gameObjects[key].length; i++) { // to go through animated and fixed. - var gameObject = this.gameObjects[key][i]; - if (gameObject instanceof Item) { - - if (gameObject.getLastMovedBy() && gameObject.getLastMovedBy().player === player) { - gameObject.setLastMovedBy(null); - } - } - } - } - }; GameController.prototype.destroy = function () { for(var player in this.players) { this.players[player].destroy(); } + // FIXME ns.client in core? Nc.trigger(Nc.ns.client.game.events.destroy); // Testing after destroy if worldUpdateObjects is empty diff --git a/app/Lib/Utilities/NotificationCenter.js b/app/Lib/Utilities/NotificationCenter.js index 9c707c5..33b4be2 100755 --- a/app/Lib/Utilities/NotificationCenter.js +++ b/app/Lib/Utilities/NotificationCenter.js @@ -138,8 +138,10 @@ function (Exception) { }, game: { player: { - killed: null - } + killed: null, + clearFingerPrints: null + }, + } }, engine: { From 062402db588f4308cb5898c78206be3dc6057756 Mon Sep 17 00:00:00 2001 From: logsol Date: Sun, 9 Oct 2016 19:27:10 +0200 Subject: [PATCH 55/68] Adds NotificationCenter exception when triggering unknown topic If you forget to add a certain topic to the Nc, you will now get an Exception with a meaningful message. --- app/Lib/Utilities/NotificationCenter.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Lib/Utilities/NotificationCenter.js b/app/Lib/Utilities/NotificationCenter.js index 33b4be2..d629b8e 100755 --- a/app/Lib/Utilities/NotificationCenter.js +++ b/app/Lib/Utilities/NotificationCenter.js @@ -23,7 +23,6 @@ function (Exception) { this.topics = {}; this.subUid = -1; - var i = 0; this.ns = { client: { pointerLock: { @@ -195,11 +194,14 @@ function (Exception) { }; populate(this.ns); - } NotificationCenter.prototype.validate = function(topic) { + if (topic === undefined) { + throw new Exception("Topic not registered in Nc. See stack trace."); + } + if (typeof topic === 'object') { throw new Exception("Topic bad format " + JSON.stringify(topic)); } From b798e6acacb7f420ef17aedb222345e1e0cf4651 Mon Sep 17 00:00:00 2001 From: logsol Date: Sun, 9 Oct 2016 19:56:06 +0200 Subject: [PATCH 56/68] Adds forward walking on shift The state of the shift modifier is now distributed across the network. Walking speeds and animation states are being updated according to it. Fixes #130 --- .../Client/Control/Inputs/KeyboardAndMouse.js | 2 ++ app/Game/Client/Control/PlayerController.js | 12 ++++++++++++ app/Game/Core/Control/PlayerController.js | 15 ++++++++++----- app/Game/Core/GameObjects/Doll.js | 6 +++--- app/Game/Core/Player.js | 13 ++++++++++++- 5 files changed, 39 insertions(+), 9 deletions(-) diff --git a/app/Game/Client/Control/Inputs/KeyboardAndMouse.js b/app/Game/Client/Control/Inputs/KeyboardAndMouse.js index 998e94f..36dea66 100644 --- a/app/Game/Client/Control/Inputs/KeyboardAndMouse.js +++ b/app/Game/Client/Control/Inputs/KeyboardAndMouse.js @@ -216,6 +216,7 @@ function (Parent, KeyboardInput, DomController, Settings, Swiper) { KeyboardAndMouse.prototype.activateModifier = function() { this.modifier = true; + this.playerController.activateModifier(); }; KeyboardAndMouse.prototype.deactivateModifier = function() { @@ -223,6 +224,7 @@ function (Parent, KeyboardInput, DomController, Settings, Swiper) { this.x = this.lastLookDirection * Settings.VIEWPORT_LOOK_AHEAD; this.y = 0; this.onXyChange(this.x, this.y); + this.playerController.deactivateModifier(); }; return KeyboardAndMouse; diff --git a/app/Game/Client/Control/PlayerController.js b/app/Game/Client/Control/PlayerController.js index 80db229..5e8033f 100755 --- a/app/Game/Client/Control/PlayerController.js +++ b/app/Game/Client/Control/PlayerController.js @@ -98,6 +98,18 @@ function (Parent, Nc, KeyboardAndMouse, Gamepad, PointerLockManager) { Nc.trigger(Nc.ns.client.game.zoomReset, false); }; + PlayerController.prototype.activateModifier = function() { + if (!this.isPlayerInputAllowed()) return; + Parent.prototype.activateModifier.call(this); + Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "activateModifier"); + }; + + PlayerController.prototype.deactivateModifier = function() { + if (!this.isPlayerInputAllowed()) return; + Parent.prototype.deactivateModifier.call(this); + Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "deactivateModifier"); + }; + /* * Client overwrite - allow player input if PointerLock is locked to canvas * and is not in between games diff --git a/app/Game/Core/Control/PlayerController.js b/app/Game/Core/Control/PlayerController.js index 62b09db..d264152 100755 --- a/app/Game/Core/Control/PlayerController.js +++ b/app/Game/Core/Control/PlayerController.js @@ -4,11 +4,7 @@ define([ function () { function PlayerController (player) { - this.player = player; - - this._shift; - this._isJumping; this._walkingDirectionStatus = 0; } @@ -31,7 +27,6 @@ function () { PlayerController.prototype.jump = function () { if(!this.isPlayerInputAllowed()) return; - this._isJumping = true; this.player.jump(); } @@ -44,6 +39,16 @@ function () { if(options) this.player.lookAt(options.x, options.y); } + PlayerController.prototype.activateModifier = function() { + if (!this.isPlayerInputAllowed()) return; + this.player.activateModifier(); + }; + + PlayerController.prototype.deactivateModifier = function() { + if (!this.isPlayerInputAllowed()) return; + this.player.deactivateModifier(); + }; + PlayerController.prototype.update = function () { if(this._walkingDirectionStatus != 0) { this.player.move(this._walkingDirectionStatus); diff --git a/app/Game/Core/GameObjects/Doll.js b/app/Game/Core/GameObjects/Doll.js index 5c8f1c2..ab258b4 100755 --- a/app/Game/Core/GameObjects/Doll.js +++ b/app/Game/Core/GameObjects/Doll.js @@ -228,14 +228,14 @@ function (Parent, Exception, Box2D, Settings, CollisionDetector, Item, Nc, Asser } }; - Doll.prototype.move = function (direction) { + Doll.prototype.move = function (direction, modifierActivated) { this.moveDirection = direction; var speed; var isHoldingHeavyItem = this.holdingItem && this.holdingItem.options.weight > Settings.MAX_RUNNING_WEIGHT; switch(true) { - case direction == this.lookDirection && this.isStanding() && !isHoldingHeavyItem: + case direction == this.lookDirection && this.isStanding() && !isHoldingHeavyItem && !modifierActivated: speed = Settings.RUN_SPEED; break; @@ -264,7 +264,7 @@ function (Parent, Exception, Box2D, Settings, CollisionDetector, Item, Nc, Asser if(this.isStanding()) { if(this.moveDirection == this.lookDirection) { - if(isHoldingHeavyItem) { + if(isHoldingHeavyItem || modifierActivated) { this.setActionState("walk"); } else { this.setActionState("run"); diff --git a/app/Game/Core/Player.js b/app/Game/Core/Player.js index 9e73e4d..5ae0259 100755 --- a/app/Game/Core/Player.js +++ b/app/Game/Core/Player.js @@ -30,6 +30,7 @@ function (Doll, PlayerController, Settings, Nc, Exception, ColorConverter, Spect this.inBetweenRounds = true; this.spectatorDoll = new SpectatorDoll(this.physicsEngine, "spectatorDoll-" + this.id, this); this.revealedGameController = revealedGameController; + this.modifierActivated = false; } Player.prototype.getNickname = function() { @@ -66,7 +67,7 @@ function (Doll, PlayerController, Settings, Nc, Exception, ColorConverter, Spect Player.prototype.move = function (direction) { if(!this.spawned) return false; - this.doll.move(direction); + this.doll.move(direction, this.modifierActivated); } Player.prototype.stop = function () { @@ -90,6 +91,16 @@ function (Doll, PlayerController, Settings, Nc, Exception, ColorConverter, Spect this.doll.lookAt(x, y); } + Player.prototype.activateModifier = function () { + if(!this.spawned) return false; + this.modifierActivated = true; + } + + Player.prototype.deactivateModifier = function () { + if(!this.spawned) return false; + this.modifierActivated = false; + } + Player.prototype.grab = function(item) { if(!this.spawned) return false; this.doll.grab(item); From 8fc1fb5d4eec84b2201aee7bd38c555f7185d061 Mon Sep 17 00:00:00 2001 From: logsol Date: Sun, 9 Oct 2016 22:00:46 +0200 Subject: [PATCH 57/68] Adds newly generated github API token to "unavailable game" page --- static/html/not_available.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/html/not_available.html b/static/html/not_available.html index 83f4670..77a5ff8 100644 --- a/static/html/not_available.html +++ b/static/html/not_available.html @@ -53,7 +53,7 @@ a { - \ No newline at end of file + From e6089687ed2744b81949907ee04dd51862b650d2 Mon Sep 17 00:00:00 2001 From: Karl Pannek Date: Tue, 15 Jul 2025 20:05:12 +0200 Subject: [PATCH 68/68] 2025 update! --- app/Bootstrap/HttpServer.js | 137 +- app/Bootstrap/Socket.js | 19 +- client.js | 8 +- package-lock.json | 2484 +++++++++++++++++++++++++++++++---- package.json | 23 +- static/vendor/screenfull.js | 174 +++ 6 files changed, 2487 insertions(+), 358 deletions(-) create mode 100644 static/vendor/screenfull.js diff --git a/app/Bootstrap/HttpServer.js b/app/Bootstrap/HttpServer.js index e8f3f2d..a1293b2 100755 --- a/app/Bootstrap/HttpServer.js +++ b/app/Bootstrap/HttpServer.js @@ -1,105 +1,74 @@ define([ - 'http', - 'node-static', + 'express', + 'http', + 'path', 'Server/Api', 'fs' ], -function (http, nodeStatic, Api, fs) { +function (express, http, path, Api, fs) { - "use strict"; + "use strict"; function HttpServer (options, coordinator) { options.port = options.port || 1234; - options.caching = typeof options.caching != 'undefined' ? options.caching : 3600; options.rootDirectory = options.rootDirectory || './'; - this.server = null; this.api = new Api(coordinator); - + this.app = express(); + this.server = http.createServer(this.app); this.init(options); } HttpServer.prototype.init = function (options) { var self = this; + var app = this.app; - //gzip true serves gzip file if there is one with .gz next to the original && if browser supports it - var fileServer = new nodeStatic.Server(options.rootDirectory, { cache: options.caching, gzip: true }); + // Serve static files + app.use('/static', express.static(path.join(options.rootDirectory, 'static'))); + app.use('/app', express.static(path.join(options.rootDirectory, 'app'))); - this.server = http.createServer( - function (req, res) { - - var fullBody = ''; - req.addListener('data', function(chunk) { // doesn't work on Jeenas computer without this - fullBody += chunk.toString(); - }); + // Serve index.html at root + app.get('/', function(req, res) { + res.sendFile(path.resolve(options.rootDirectory, 'static/html/index.html')); + }); - req.addListener('error', function(err) { - console.log(''); - }); - - - req.addListener('end', function () { - - switch(true) { - case req.url == '/': - fileServer.serveFile('./static/html/index.html', 200, {}, req, res); - console.checkpoint('HTTP Server serves index'); - break; - - case req.url == '/client.js': - fs.exists('./build/client.min.js', function (exists) { - if (process.env.NODE_ENV && process.env.NODE_ENV == 'production' && exists) { - fileServer.serveFile('./build/client.min.js', 200, {}, req, res); - } else { - fileServer.serveFile('./client.js', 200, {}, req, res); - } - }); - break; - - case req.url == '/client.min.js': - fileServer.serveFile('./build/client.min.js', 200, {}, req, res); - break; - - case req.url == '/require.js': - fileServer.serveFile('./node_modules/requirejs/require.js', 200, {}, req, res); - break; - - case req.url == '/screenfull.js': - fileServer.serveFile('./node_modules/screenfull/dist/screenfull.js', 200, {}, req, res); - break; - - case req.url == '/chart.js': - fileServer.serveFile('./node_modules/chart.js/Chart.js', 200, {}, req, res); - break; - - case req.url == '/api': - self.api.handleCall(fullBody); - var status = self.api.isError ? 400 : 200; - res.writeHead(status, {"Content-Type": self.api.getContentType()}); - res.end(self.api.getOutput()); - self.api.isError = false; - break; - - case new RegExp(/^\/app/).test(req.url): - fileServer.serve(req, res, function () { - self.handleFileError(res) - }); - break; - - case new RegExp(/^\/static/).test(req.url): - fileServer.serve(req, res, function () { - self.handleFileError(res) - }); - break; - - default: - self.handleFileError(res); - break; - } - }); + // Serve client.js and minified version + app.get('/client.js', function(req, res) { + if (process.env.NODE_ENV === 'production' && fs.existsSync(path.resolve(options.rootDirectory, 'build/client.min.js'))) { + res.sendFile(path.resolve(options.rootDirectory, 'build/client.min.js')); + } else { + res.sendFile(path.resolve(options.rootDirectory, 'client.js')); } - ); + }); + app.get('/client.min.js', function(req, res) { + res.sendFile(path.resolve(options.rootDirectory, 'build/client.min.js')); + }); + + // Serve require.js, screenfull.js, chart.js from node_modules + app.get('/require.js', function(req, res) { + res.sendFile(path.resolve(options.rootDirectory, 'node_modules/requirejs/require.js')); + }); + app.get('/screenfull.js', function(req, res) { + res.sendFile(path.resolve(options.rootDirectory, 'static/vendor/screenfull.js')); + }); + app.get('/chart.js', function(req, res) { + // Chart.js v4 uses 'dist/chart.umd.js' + res.sendFile(path.resolve(options.rootDirectory, 'node_modules/chart.js/dist/chart.umd.js')); + }); + + // API endpoint + app.post('/api', express.text({type: '*/*'}), function(req, res) { + self.api.handleCall(req.body); + var status = self.api.isError ? 400 : 200; + res.status(status).type(self.api.getContentType()).send(self.api.getOutput()); + self.api.isError = false; + }); + + // 404 handler + app.use(function(req, res) { + res.status(404).send('

    404 not ... found

    '); + }); this.server.once('error', function(err) { if(err.code == 'EADDRINUSE') { @@ -110,7 +79,6 @@ function (http, nodeStatic, Api, fs) { }); this.server.listen(options.port); - console.checkpoint('start HTTP server'); } @@ -118,10 +86,5 @@ function (http, nodeStatic, Api, fs) { return this.server; } - HttpServer.prototype.handleFileError = function (res) { - res.writeHead(404, {'Content-Type': 'text/html'}); - res.end('

    404 not ... found

    '); - } - return HttpServer; }); \ No newline at end of file diff --git a/app/Bootstrap/Socket.js b/app/Bootstrap/Socket.js index 49314f5..c9a652e 100755 --- a/app/Bootstrap/Socket.js +++ b/app/Bootstrap/Socket.js @@ -4,30 +4,23 @@ define([ function (io) { - "use strict"; + "use strict"; function Socket (server, options, coordinator) { - options.logLevel = typeof options.logLevel != 'undefined' - ? options.logLevel - : 0; - this.coordinator = coordinator; - this.socket = io(server, { - 'log level': options.logLevel, - //'transports': ['websockets'] + this.io = io(server, { + // No more 'log level' or 'transports' in v4 + // Add any v4-compatible options here if needed }); - this.init(options); } Socket.prototype.init = function (options) { - var self = this; - this.socket.on('connection', function (user) { + this.io.on('connection', function (socket) { console.checkpoint('socket receiving connection'); - self.onConnection(user); + self.onConnection(socket); }); - console.checkpoint('start Socket Listener'); } diff --git a/client.js b/client.js index c928e88..f96233a 100755 --- a/client.js +++ b/client.js @@ -32,13 +32,7 @@ function (Networker, io, Settings, Exception, nc, Menu) { var menu = new Menu(); menu.onRun = function(channelName, nickname) { var options = { - "reconnect": false, - "reconnection delay": 500, - "max reconnection attempts": 10, - "transports": [ - "websocket", - "flashsocket" - ] + transports: ["websocket"] // v4: only use websocket, flashsocket is gone }; var socket = io("/", options); var networker = new Networker(socket, channelName, nickname); diff --git a/package-lock.json b/package-lock.json index a183782..3f2a506 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,90 +1,1578 @@ { "name": "chuck.js", "version": "0.1.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, - "dependencies": { - "accepts": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz", - "integrity": "sha1-w8p0NJOGSMPg2cHjKN1otiLChMo=", - "requires": { - "mime-types": "2.1.17", - "negotiator": "0.6.1" + "packages": { + "": { + "name": "chuck.js", + "version": "0.1.0", + "dependencies": { + "chart.js": "^4.4.0", + "express": "^4.18.2", + "requirejs": "^2.3.6", + "screenfull": "^6.0.2", + "socket.io": "^4.7.4" + }, + "devDependencies": { + "nodemon": "^3.0.2" + }, + "engines": { + "node": ">=16.0.0" } }, - "after": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", - "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" + "node_modules/@kurkle/color": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.4.tgz", + "integrity": "sha512-M5UknZPHRu3DEDWoipU6sE8PdkZ6Z/S+v4dD+Ke8IaNlpdSQah50lz1KtcFBa2vsdOnwbbnxJwVM4wty6udA5w==" }, - "arraybuffer.slice": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz", - "integrity": "sha1-8zshWfBTKj8xB6JywMz70a0peco=" + "node_modules/@socket.io/component-emitter": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", + "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==" }, - "backo2": { + "node_modules/@types/cors": { + "version": "2.8.19", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.19.tgz", + "integrity": "sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/node": { + "version": "24.0.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.14.tgz", + "integrity": "sha512-4zXMWD91vBLGRtHK3YbIoFMia+1nqEz72coM42C5ETjnNCa/heoj7NT1G67iAfOqMmcfhuCZ4uNpyz8EjlAejw==", + "dependencies": { + "undici-types": "~7.8.0" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/balanced-match": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", - "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=" + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, - "base64-arraybuffer": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", - "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=" + "node_modules/base64id": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", + "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", + "engines": { + "node": "^4.5.0 || >= 5.9" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chart.js": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.5.0.tgz", + "integrity": "sha512-aYeC/jDgSEx8SHWZvANYMioYMZ2KX02W6f6uVfyteuCGcadDLcYVHdfdygsTQkQ4TKn5lghoojAsPj5pu0SnvQ==", + "dependencies": { + "@kurkle/color": "^0.3.0" + }, + "engines": { + "pnpm": ">=8" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/engine.io": { + "version": "6.6.4", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.4.tgz", + "integrity": "sha512-ZCkIjSYNDyGn0R6ewHDtXgns/Zre/NT6Agvq1/WobF7JXgFff4SeDroKiCO3fNJreU9YG429Sc81o4w5ok/W5g==", + "dependencies": { + "@types/cors": "^2.8.12", + "@types/node": ">=10.0.0", + "accepts": "~1.3.4", + "base64id": "2.0.0", + "cookie": "~0.7.2", + "cors": "~2.8.5", + "debug": "~4.3.1", + "engine.io-parser": "~5.2.1", + "ws": "~8.17.1" + }, + "engines": { + "node": ">=10.2.0" + } + }, + "node_modules/engine.io-parser": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz", + "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/engine.io/node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/engine.io/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/engine.io/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.3", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.7.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.3.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.12", + "proxy-addr": "~2.0.7", + "qs": "6.13.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.19.0", + "serve-static": "1.16.2", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nodemon": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.10.tgz", + "integrity": "sha512-WDjw3pJ0/0jMFmyNDp3gvY2YizjLmmOUQo6DEBY+JgdvW/yQ9mEeSw6H5ythl5Ny2ytb7f9C2nIbjSxMNzbJXw==", + "dev": true, + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/nodemon/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/requirejs": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.7.tgz", + "integrity": "sha512-DouTG8T1WanGok6Qjg2SXuCMzszOo0eHeH9hDZ5Y4x8Je+9JB38HdTLT4/VA8OaUhBa0JPVHJ0pyBkM1z+pDsw==", + "bin": { + "r_js": "bin/r.js", + "r.js": "bin/r.js" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/screenfull": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/screenfull/-/screenfull-6.0.2.tgz", + "integrity": "sha512-AQdy8s4WhNvUZ6P8F6PB21tSPIYKniic+Ogx0AacBMjKP1GUHN2E9URxQHtCusiwxudnCKkdy4GrHXPPJSkCCw==", + "engines": { + "node": "^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/socket.io": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.1.tgz", + "integrity": "sha512-oZ7iUCxph8WYRHHcjBEc9unw3adt5CmSNlppj/5Q4k2RIrhl8Z5yY2Xr4j9zj0+wzVZ0bxmYoGSzKJnRl6A4yg==", + "dependencies": { + "accepts": "~1.3.4", + "base64id": "~2.0.0", + "cors": "~2.8.5", + "debug": "~4.3.2", + "engine.io": "~6.6.0", + "socket.io-adapter": "~2.5.2", + "socket.io-parser": "~4.2.4" + }, + "engines": { + "node": ">=10.2.0" + } + }, + "node_modules/socket.io-adapter": { + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.5.tgz", + "integrity": "sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg==", + "dependencies": { + "debug": "~4.3.4", + "ws": "~8.17.1" + } + }, + "node_modules/socket.io-adapter/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socket.io-adapter/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/socket.io-parser": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", + "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/socket.io-parser/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socket.io-parser/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/socket.io/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socket.io/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", + "dev": true, + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true + }, + "node_modules/undici-types": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz", + "integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/ws": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + } + }, + "dependencies": { + "@kurkle/color": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.4.tgz", + "integrity": "sha512-M5UknZPHRu3DEDWoipU6sE8PdkZ6Z/S+v4dD+Ke8IaNlpdSQah50lz1KtcFBa2vsdOnwbbnxJwVM4wty6udA5w==" + }, + "@socket.io/component-emitter": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", + "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==" + }, + "@types/cors": { + "version": "2.8.19", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.19.tgz", + "integrity": "sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==", + "requires": { + "@types/node": "*" + } + }, + "@types/node": { + "version": "24.0.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.14.tgz", + "integrity": "sha512-4zXMWD91vBLGRtHK3YbIoFMia+1nqEz72coM42C5ETjnNCa/heoj7NT1G67iAfOqMmcfhuCZ4uNpyz8EjlAejw==", + "requires": { + "undici-types": "~7.8.0" + } + }, + "accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "requires": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + } + }, + "anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, "base64id": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz", - "integrity": "sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY=" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", + "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==" }, - "better-assert": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", - "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", + "binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true + }, + "body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "requires": { - "callsite": "1.0.0" + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" } }, - "blob": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz", - "integrity": "sha1-vPEwUspURj8w+fx+lbmkdjCpSSE=" + "brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } }, - "callsite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", - "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=" + "braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "requires": { + "fill-range": "^7.1.1" + } + }, + "bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" + }, + "call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + } + }, + "call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "requires": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + } }, "chart.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-1.0.1.tgz", - "integrity": "sha1-sJ2Dv0qn5+zh4GsvaJjC36V1DAU=" + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.5.0.tgz", + "integrity": "sha512-aYeC/jDgSEx8SHWZvANYMioYMZ2KX02W6f6uVfyteuCGcadDLcYVHdfdygsTQkQ4TKn5lghoojAsPj5pu0SnvQ==", + "requires": { + "@kurkle/color": "^0.3.0" + } }, - "colors": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", - "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=" + "chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } }, - "component-bind": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", - "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=" + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true }, - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + "content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "requires": { + "safe-buffer": "5.2.1" + } }, - "component-inherit": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", - "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=" + "content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" }, "cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "requires": { + "object-assign": "^4", + "vary": "^1" + } }, "debug": { "version": "2.6.9", @@ -94,95 +1582,359 @@ "ms": "2.0.0" } }, - "engine.io": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.1.3.tgz", - "integrity": "sha1-euz3G/ijEPn6IUYZmcT8wDX4qHc=", + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" + }, + "destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" + }, + "dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", "requires": { - "accepts": "1.3.3", - "base64id": "1.0.0", - "cookie": "0.3.1", - "debug": "2.6.9", - "engine.io-parser": "2.1.1", - "uws": "0.14.5", - "ws": "2.3.1" + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" } }, - "engine.io-client": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.1.3.tgz", - "integrity": "sha1-1wXkiYXf6LVKmMn3cFK4sIJYvgU=", + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==" + }, + "engine.io": { + "version": "6.6.4", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.4.tgz", + "integrity": "sha512-ZCkIjSYNDyGn0R6ewHDtXgns/Zre/NT6Agvq1/WobF7JXgFff4SeDroKiCO3fNJreU9YG429Sc81o4w5ok/W5g==", "requires": { - "component-emitter": "1.2.1", - "component-inherit": "0.0.3", - "debug": "2.6.9", - "engine.io-parser": "2.1.1", - "has-cors": "1.1.0", - "indexof": "0.0.1", - "parseqs": "0.0.5", - "parseuri": "0.0.5", - "ws": "2.3.1", - "xmlhttprequest-ssl": "1.5.4", - "yeast": "0.1.2" + "@types/cors": "^2.8.12", + "@types/node": ">=10.0.0", + "accepts": "~1.3.4", + "base64id": "2.0.0", + "cookie": "~0.7.2", + "cors": "~2.8.5", + "debug": "~4.3.1", + "engine.io-parser": "~5.2.1", + "ws": "~8.17.1" + }, + "dependencies": { + "cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==" + }, + "debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + } } }, "engine.io-parser": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.1.1.tgz", - "integrity": "sha1-4Ps/DgRi9/WLt3waUun1p+JuRmg=", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz", + "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==" + }, + "es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==" + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" + }, + "es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", "requires": { - "after": "0.8.2", - "arraybuffer.slice": "0.0.6", - "base64-arraybuffer": "0.1.5", - "blob": "0.0.4", - "has-binary2": "1.0.2" + "es-errors": "^1.3.0" } }, - "has-binary2": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.2.tgz", - "integrity": "sha1-6D26SfC5vk0CbSc2U1DZ8D9Uvpg=", + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" + }, + "express": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "requires": { - "isarray": "2.0.1" + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.3", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.7.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.3.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.12", + "proxy-addr": "~2.0.7", + "qs": "6.13.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.19.0", + "serve-static": "1.16.2", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" } }, - "has-cors": { + "fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "finalhandler": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", + "requires": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + } + }, + "forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" + }, + "fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" + }, + "get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "requires": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + } + }, + "get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "requires": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "has-symbols": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", - "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=" + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==" }, - "indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "requires": { + "function-bind": "^1.1.2" + } }, - "isarray": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", - "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=" + "http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "requires": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==" + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" + }, + "merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==" }, "mime": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" }, "mime-db": { - "version": "1.30.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", - "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=" + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" }, "mime-types": { - "version": "2.1.17", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", - "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "requires": { - "mime-db": "1.30.0" + "mime-db": "1.52.0" } }, - "minimist": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=" + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } }, "ms": { "version": "2.0.0", @@ -190,163 +1942,411 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "negotiator": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, - "node-fork": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/node-fork/-/node-fork-0.4.2.tgz", - "integrity": "sha1-h6TK72LDutp5l/O1M/va53fHljg=" - }, - "node-static": { - "version": "0.7.10", - "resolved": "https://registry.npmjs.org/node-static/-/node-static-0.7.10.tgz", - "integrity": "sha512-bd7zO5hvCWzdglgwz9t82T4mYTEUzEG5pXnSqEzitvmEacusbhl8/VwuCbMaYR9g2PNK5191yBtAEQLJEmQh1A==", + "nodemon": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.10.tgz", + "integrity": "sha512-WDjw3pJ0/0jMFmyNDp3gvY2YizjLmmOUQo6DEBY+JgdvW/yQ9mEeSw6H5ythl5Ny2ytb7f9C2nIbjSxMNzbJXw==", + "dev": true, "requires": { - "colors": "1.1.2", - "mime": "1.4.1", - "optimist": "0.6.1" + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "dependencies": { + "debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } } }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==" }, - "object-component": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", - "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=" + "object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==" }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "requires": { - "minimist": "0.0.10", - "wordwrap": "0.0.3" + "ee-first": "1.1.1" } }, - "parseqs": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", - "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + }, + "path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==" + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + }, + "proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", "requires": { - "better-assert": "1.0.2" + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" } }, - "parseuri": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", - "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", + "pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, + "qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "requires": { - "better-assert": "1.0.2" + "side-channel": "^1.0.6" + } + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" + }, + "raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "requires": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" } }, "requirejs": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.0.4.tgz", - "integrity": "sha1-nrTFWd80hYsC+e+dmKNPTK5w2JE=" + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.7.tgz", + "integrity": "sha512-DouTG8T1WanGok6Qjg2SXuCMzszOo0eHeH9hDZ5Y4x8Je+9JB38HdTLT4/VA8OaUhBa0JPVHJ0pyBkM1z+pDsw==" }, "safe-buffer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz", - "integrity": "sha1-0mPKVGls2KMGtcplUekt5XkY++c=" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "screenfull": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/screenfull/-/screenfull-3.3.2.tgz", - "integrity": "sha512-zrnT8EidEWGFkmXEa1d/YUYNvvJaMX05g4O82K+Oiy9jR6Fh3ZTsovsccJOjRJyhS0KPV7AQpDFQRAYXBl9a5A==" + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/screenfull/-/screenfull-6.0.2.tgz", + "integrity": "sha512-AQdy8s4WhNvUZ6P8F6PB21tSPIYKniic+Ogx0AacBMjKP1GUHN2E9URxQHtCusiwxudnCKkdy4GrHXPPJSkCCw==" }, - "socket.io": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.0.3.tgz", - "integrity": "sha1-Q1nwaiSTOua9CHeYr3jGgOrjReM=", + "semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true + }, + "send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "requires": { "debug": "2.6.9", - "engine.io": "3.1.3", - "object-assign": "4.1.1", - "socket.io-adapter": "1.1.1", - "socket.io-client": "2.0.4", - "socket.io-parser": "3.1.2" + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "dependencies": { + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + } + } + }, + "serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "requires": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" + } + }, + "setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + } + }, + "side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + } + }, + "side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + } + }, + "side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + } + }, + "simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "dev": true, + "requires": { + "semver": "^7.5.3" + } + }, + "socket.io": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.1.tgz", + "integrity": "sha512-oZ7iUCxph8WYRHHcjBEc9unw3adt5CmSNlppj/5Q4k2RIrhl8Z5yY2Xr4j9zj0+wzVZ0bxmYoGSzKJnRl6A4yg==", + "requires": { + "accepts": "~1.3.4", + "base64id": "~2.0.0", + "cors": "~2.8.5", + "debug": "~4.3.2", + "engine.io": "~6.6.0", + "socket.io-adapter": "~2.5.2", + "socket.io-parser": "~4.2.4" + }, + "dependencies": { + "debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + } } }, "socket.io-adapter": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz", - "integrity": "sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs=" - }, - "socket.io-client": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.0.4.tgz", - "integrity": "sha1-CRilUkBtxeVAs4Dc2Xr8SmQzL44=", + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.5.tgz", + "integrity": "sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg==", "requires": { - "backo2": "1.0.2", - "base64-arraybuffer": "0.1.5", - "component-bind": "1.0.0", - "component-emitter": "1.2.1", - "debug": "2.6.9", - "engine.io-client": "3.1.3", - "has-cors": "1.1.0", - "indexof": "0.0.1", - "object-component": "0.0.3", - "parseqs": "0.0.5", - "parseuri": "0.0.5", - "socket.io-parser": "3.1.2", - "to-array": "0.1.4" + "debug": "~4.3.4", + "ws": "~8.17.1" + }, + "dependencies": { + "debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + } } }, "socket.io-parser": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.1.2.tgz", - "integrity": "sha1-28IoIVH8T6675Aru3Ady66YZ9/I=", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", + "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", "requires": { - "component-emitter": "1.2.1", - "debug": "2.6.9", - "has-binary2": "1.0.2", - "isarray": "2.0.1" + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1" + }, + "dependencies": { + "debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + } } }, - "to-array": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", - "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=" + "statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" }, - "ultron": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.0.tgz", - "integrity": "sha1-sHoualQagV/Go0zNRTO67DB8qGQ=" + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } }, - "uws": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/uws/-/uws-0.14.5.tgz", - "integrity": "sha1-Z6rzPEaypYel9mZtAPdpEyjxSdw=", - "optional": true + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } }, - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" + "toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" + }, + "touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", + "dev": true + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, + "undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true + }, + "undici-types": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz", + "integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==" + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" }, "ws": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-2.3.1.tgz", - "integrity": "sha1-a5Sz5EfLajY/eF6vlK9jWejoHIA=", - "requires": { - "safe-buffer": "5.0.1", - "ultron": "1.1.0" - } - }, - "xmlhttprequest-ssl": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.4.tgz", - "integrity": "sha1-BPVgkVcks4kIhxXMDteBPpZ3v1c=" - }, - "yeast": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", - "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=" + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "requires": {} } } } diff --git a/package.json b/package.json index 6dc63ab..6fbcbb3 100755 --- a/package.json +++ b/package.json @@ -15,23 +15,28 @@ "url": "https://github.com/logsol/chuck.js/issues", "email": "fartman@gmx.de" }, - "main": "", + "main": "server.js", "dependencies": { - "socket.io": "= 2.0.3", - "node-static": ">= 0.6.0", - "requirejs": "= 2.0.4", - "node-fork": ">= 0.4.2", - "screenfull": ">= 1.0.4", - "chart.js": "= 1.0.1" + "socket.io": "^4.7.4", + "express": "^4.18.2", + "requirejs": "^2.3.6", + "screenfull": "^6.0.2", + "chart.js": "^4.4.0" + }, + "devDependencies": { + "nodemon": "^3.0.2" }, - "devDependencies": {}, "optionalDependencies": {}, - "engine": "node >= 0.8.4", + "engines": { + "node": ">=16.0.0" + }, "config": { "port": "1234" }, "private": true, "scripts": { + "start": "node server.js", + "dev": "nodemon server.js", "prestart": "scripts/build.sh" } } diff --git a/static/vendor/screenfull.js b/static/vendor/screenfull.js new file mode 100644 index 0000000..e882448 --- /dev/null +++ b/static/vendor/screenfull.js @@ -0,0 +1,174 @@ +/* eslint-disable promise/prefer-await-to-then */ + +const methodMap = [ + [ + 'requestFullscreen', + 'exitFullscreen', + 'fullscreenElement', + 'fullscreenEnabled', + 'fullscreenchange', + 'fullscreenerror', + ], + // New WebKit + [ + 'webkitRequestFullscreen', + 'webkitExitFullscreen', + 'webkitFullscreenElement', + 'webkitFullscreenEnabled', + 'webkitfullscreenchange', + 'webkitfullscreenerror', + + ], + // Old WebKit + [ + 'webkitRequestFullScreen', + 'webkitCancelFullScreen', + 'webkitCurrentFullScreenElement', + 'webkitCancelFullScreen', + 'webkitfullscreenchange', + 'webkitfullscreenerror', + + ], + [ + 'mozRequestFullScreen', + 'mozCancelFullScreen', + 'mozFullScreenElement', + 'mozFullScreenEnabled', + 'mozfullscreenchange', + 'mozfullscreenerror', + ], + [ + 'msRequestFullscreen', + 'msExitFullscreen', + 'msFullscreenElement', + 'msFullscreenEnabled', + 'MSFullscreenChange', + 'MSFullscreenError', + ], +]; + +const nativeAPI = (() => { + if (typeof document === 'undefined') { + return false; + } + + const unprefixedMethods = methodMap[0]; + const returnValue = {}; + + for (const methodList of methodMap) { + const exitFullscreenMethod = methodList?.[1]; + if (exitFullscreenMethod in document) { + for (const [index, method] of methodList.entries()) { + returnValue[unprefixedMethods[index]] = method; + } + + return returnValue; + } + } + + return false; +})(); + +const eventNameMap = { + change: nativeAPI.fullscreenchange, + error: nativeAPI.fullscreenerror, +}; + +// eslint-disable-next-line import/no-mutable-exports +let screenfull = { + // eslint-disable-next-line default-param-last + request(element = document.documentElement, options) { + return new Promise((resolve, reject) => { + const onFullScreenEntered = () => { + screenfull.off('change', onFullScreenEntered); + resolve(); + }; + + screenfull.on('change', onFullScreenEntered); + + const returnPromise = element[nativeAPI.requestFullscreen](options); + + if (returnPromise instanceof Promise) { + returnPromise.then(onFullScreenEntered).catch(reject); + } + }); + }, + exit() { + return new Promise((resolve, reject) => { + if (!screenfull.isFullscreen) { + resolve(); + return; + } + + const onFullScreenExit = () => { + screenfull.off('change', onFullScreenExit); + resolve(); + }; + + screenfull.on('change', onFullScreenExit); + + const returnPromise = document[nativeAPI.exitFullscreen](); + + if (returnPromise instanceof Promise) { + returnPromise.then(onFullScreenExit).catch(reject); + } + }); + }, + toggle(element, options) { + return screenfull.isFullscreen ? screenfull.exit() : screenfull.request(element, options); + }, + onchange(callback) { + screenfull.on('change', callback); + }, + onerror(callback) { + screenfull.on('error', callback); + }, + on(event, callback) { + const eventName = eventNameMap[event]; + if (eventName) { + document.addEventListener(eventName, callback, false); + } + }, + off(event, callback) { + const eventName = eventNameMap[event]; + if (eventName) { + document.removeEventListener(eventName, callback, false); + } + }, + raw: nativeAPI, +}; + +Object.defineProperties(screenfull, { + isFullscreen: { + get: () => Boolean(document[nativeAPI.fullscreenElement]), + }, + element: { + enumerable: true, + get: () => document[nativeAPI.fullscreenElement] ?? undefined, + }, + isEnabled: { + enumerable: true, + // Coerce to boolean in case of old WebKit. + get: () => Boolean(document[nativeAPI.fullscreenEnabled]), + }, +}); + +if (!nativeAPI) { + screenfull = {isEnabled: false}; +} + +// UMD wrapper to make screenfull available globally +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD + define(factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS + module.exports = factory(); + } else { + // Browser globals + root.screenfull = factory(); + } +}(typeof self !== 'undefined' ? self : this, function () { + return screenfull; +})); \ No newline at end of file