From 7476703f37a69d0d8e8386226f445b914d153a19 Mon Sep 17 00:00:00 2001 From: cha0s Date: Wed, 2 Oct 2019 00:38:09 -0500 Subject: [PATCH] fix: collisions --- server/create-entity-for-connection.js | 10 +++++++--- server/fixtures/fire.entity.js | 5 +++-- server/fixtures/flower-barrel.entity.js | 9 ++++++++- server/fixtures/kitty.entity.js | 10 +++++++++- server/fixtures/rock-projectile.entity.js | 1 + 5 files changed, 28 insertions(+), 7 deletions(-) diff --git a/server/create-entity-for-connection.js b/server/create-entity-for-connection.js index d8dc38f..a412e8c 100644 --- a/server/create-entity-for-connection.js +++ b/server/create-entity-for-connection.js @@ -27,9 +27,13 @@ export function createEntityForConnection(socket) { }, }, collider: { - // params: { - // collisionGroup: 'player', - // }, + params: { + collidesWithGroups: [ + 'default', + 'environmental', + 'projectile', + ], + }, }, controllable: {}, directional: { diff --git a/server/fixtures/fire.entity.js b/server/fixtures/fire.entity.js index 171a01f..94a3e1c 100644 --- a/server/fixtures/fire.entity.js +++ b/server/fixtures/fire.entity.js @@ -28,6 +28,7 @@ export function fireJSON() { }, collider: { params: { + collisionGroup: 'environmental', isSensor: true, }, }, @@ -37,8 +38,8 @@ export function fireJSON() { damageSpecs: [ { affinity: AFFINITY_FIRE, - lock: 0.45, - power: 15, + lock: 0.15, + power: 5, variance: 0.25, }, ], diff --git a/server/fixtures/flower-barrel.entity.js b/server/fixtures/flower-barrel.entity.js index 83594f0..ac18265 100644 --- a/server/fixtures/flower-barrel.entity.js +++ b/server/fixtures/flower-barrel.entity.js @@ -13,7 +13,14 @@ export function flowerBarrelJSON() { life: 1000, }, }, - collider: {}, + collider: { + params: { + collidesWithGroups: [ + 'default', + 'environmental', + ], + }, + }, emitter: {}, existent: { state: { diff --git a/server/fixtures/kitty.entity.js b/server/fixtures/kitty.entity.js index c740fb8..9fcab79 100644 --- a/server/fixtures/kitty.entity.js +++ b/server/fixtures/kitty.entity.js @@ -81,7 +81,15 @@ export function kittyJSON() { }, }, }, - collider: {}, + collider: { + params: { + collidesWithGroups: [ + 'default', + 'environmental', + 'projectile', + ], + }, + }, directional: { params: { directionCount: 4, diff --git a/server/fixtures/rock-projectile.entity.js b/server/fixtures/rock-projectile.entity.js index 9c2b05e..1b052f4 100644 --- a/server/fixtures/rock-projectile.entity.js +++ b/server/fixtures/rock-projectile.entity.js @@ -129,6 +129,7 @@ export function rockProjectileJSON() { }, collider: { params: { + collisionGroup: 'projectile', collisionStartActions: { type: 'actions', traversals: [