diff --git a/app/Game/Channel/GameObjects/Doll.js b/app/Game/Channel/GameObjects/Doll.js index ea5fa0f..85510b6 100755 --- a/app/Game/Channel/GameObjects/Doll.js +++ b/app/Game/Channel/GameObjects/Doll.js @@ -59,10 +59,13 @@ function (Parent, Item, Box2D, Nc) { if(item.lastMoved && item.lastMoved.player != this.player) { var damageVector = b2Math.SubtractVV(itemVelocity, ownVelocity); damageVector.Abs(); - damageVector.Multiply(0.7); - damageVector.Multiply(itemMass * 1.3); + var velocity = damageVector.Length(); + damageVector.Multiply(itemMass / 3.6); var damage = damageVector.Length(); - damage *= item.options.danger ? item.options.danger : 1; + + if(item.options.danger) { + damage += item.options.danger * 90 * (velocity / 128) * (itemMass + 1); + } var player = item.lastMoved.player; diff --git a/app/Game/Client/Control/Inputs/KeyboardAndMouse.js b/app/Game/Client/Control/Inputs/KeyboardAndMouse.js index 5531f8c..6814d1d 100644 --- a/app/Game/Client/Control/Inputs/KeyboardAndMouse.js +++ b/app/Game/Client/Control/Inputs/KeyboardAndMouse.js @@ -115,7 +115,11 @@ function (Parent, KeyboardInput, DomController, Settings, Swiper) { self.playerController.handActionRequest(options); } else { self.swiper = new Swiper(); - self.swiper.draw(e); + + self.draw({ + movementX: 0, + movementY: 0 + }); } } @@ -184,6 +188,7 @@ function (Parent, KeyboardInput, DomController, Settings, Swiper) { this.mousePosition.x += movementX; this.mousePosition.y += movementY; + this.swiper.swipe(this.mousePosition.x, -this.mousePosition.y); }; diff --git a/app/Game/Config/ItemSettings.js b/app/Game/Config/ItemSettings.js index e01e953..5c95941 100644 --- a/app/Game/Config/ItemSettings.js +++ b/app/Game/Config/ItemSettings.js @@ -2,6 +2,8 @@ define(function() { var ItemSettings = { + // weight is a number between 0.1 for very light and 10 for very heavy + "Default": { "category": "", @@ -15,7 +17,7 @@ define(function() { "rotation": "0", "bounce": "0", "grabAngle": "-1.5", - "danger": "1", + "danger": "0", "bodyType": "dynamic", }, @@ -25,7 +27,7 @@ define(function() { "image": "chest.png", "type": "ragdoll", - "weight": "5", + "weight": "7", "width": "6", "height": "12", @@ -200,7 +202,7 @@ define(function() { "category": "kitchen", "image": "fridge.gif", - "weight": "10", + "weight": "5", "width": "31", "height": "53", @@ -213,11 +215,12 @@ define(function() { "category": "kitchen", "image": "microwave.gif", - "weight": "3.6", + "weight": "4.6", "width": "19", "height": "12", "grabAngle": "-0.1", + "danger": "2", }, "Coffeemachine": diff --git a/app/Game/Config/Settings.js b/app/Game/Config/Settings.js index d46c961..25257d1 100755 --- a/app/Game/Config/Settings.js +++ b/app/Game/Config/Settings.js @@ -36,7 +36,7 @@ define(function() { WALK_SPEED: 4, RUN_SPEED: 8, FLY_SPEED: 6.2, - JUMP_SPEED: 21, + JUMP_SPEED: 19, JUMP_STOP_DAMPING_FACTOR: 0.5, MAX_THROW_FORCE: 28, MAX_THROW_ANGULAR_VELOCITY: 3, @@ -51,7 +51,7 @@ define(function() { TILE_FRICTION: 0.99, TILE_RESTITUTION: 0.1, - PLAYER_DENSITY: 3.68, + PLAYER_DENSITY: 12.2, //3.68, PLAYER_FRICTION: 5, PLAYER_MOTION_FRICTION: 0.1, PLAYER_RESTITUTION: 0.0, diff --git a/app/Game/Core/GameObjects/Doll.js b/app/Game/Core/GameObjects/Doll.js index eb2b3a5..4bfe6f7 100755 --- a/app/Game/Core/GameObjects/Doll.js +++ b/app/Game/Core/GameObjects/Doll.js @@ -278,7 +278,10 @@ function (Parent, Box2D, Settings, CollisionDetector, Item, Nc) { if (this.isStanding()) { this.body.SetAwake(true); - var vector = new Box2D.Common.Math.b2Vec2(0, -Settings.JUMP_SPEED); + + var jumpSpeed = Settings.JUMP_SPEED; + + var vector = new Box2D.Common.Math.b2Vec2(0, -jumpSpeed); this.body.SetLinearVelocity(vector); this.setStanding(false); diff --git a/app/Game/Core/GameObjects/Item.js b/app/Game/Core/GameObjects/Item.js index a350bb9..6109010 100644 --- a/app/Game/Core/GameObjects/Item.js +++ b/app/Game/Core/GameObjects/Item.js @@ -72,10 +72,7 @@ function (Parent, Box2D, Options, Settings, Exception, Nc) { var fixtureDef = new Box2D.Dynamics.b2FixtureDef(); fixtureDef.shape = itemShape; - var offset = 4, - factor = 80; - var density = ((this.options.weight + offset) / this.options.width / this.options.height) * factor; - fixtureDef.density = density; + fixtureDef.density = this.options.weight; fixtureDef.friction = Settings.ITEM_FRICTION; fixtureDef.restitution = this.options.bounce diff --git a/app/Server/Api.js b/app/Server/Api.js index 666bb09..a99bb31 100644 --- a/app/Server/Api.js +++ b/app/Server/Api.js @@ -157,7 +157,7 @@ function (Nc, ProtocolHelper, validate, Options, Settings, FileSystem) { maps.push(fileinfo[0]); } }; - return maps.sort(); + return ["stones"];//maps.sort(); }; return Api;