From b0135112eaede4fc1ddc42ce812b02852fadab04 Mon Sep 17 00:00:00 2001 From: ghostlyzsh Date: Mon, 8 Jan 2024 00:31:15 -0600 Subject: [PATCH] position is back and divided by 10 now --- server/src/main.rs | 8 ++++++-- starkingdoms-client/src/hub.ts | 12 ++++++------ starkingdoms-client/src/pages/Play.svelte | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/server/src/main.rs b/server/src/main.rs index 0851f77a35337af63af06a2a94e6efa10bd1ae3d..38a4d6d5c7f94fb5bcb47b8fbc32e3d857b2f0e6 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -1061,7 +1061,9 @@ fn load_savefile( Collider::cuboid(PART_HALF_SIZE / SCALE, PART_HALF_SIZE / SCALE) } else if part_type == PartType::LandingThruster { Collider::cuboid(PART_HALF_SIZE / SCALE, 18.75 / SCALE) - } else { Collider::cuboid(PART_HALF_SIZE / SCALE, PART_HALF_SIZE / SCALE) }) + } else { + Collider::cuboid(PART_HALF_SIZE / SCALE, PART_HALF_SIZE / SCALE) + }) .insert(TransformBundle::from(Transform::from_xyz( 0., if part_type == PartType::Cargo { @@ -1070,7 +1072,9 @@ fn load_savefile( 0. / SCALE } else if part_type == PartType::LandingThruster { 6.25 / SCALE - } else { 0. / SCALE }, + } else { + 0. / SCALE + }, 0., ))); }) diff --git a/starkingdoms-client/src/hub.ts b/starkingdoms-client/src/hub.ts index 68d7c89a0a8e00101cb2f06c8951e885145e5c29..3ac33232195cebdf838f7854975df456e3e2bf38 100644 --- a/starkingdoms-client/src/hub.ts +++ b/starkingdoms-client/src/hub.ts @@ -230,17 +230,17 @@ export async function hub_connect( if (hud.next_poll <= 0) { velocity!.innerText = Math.round( Math.sqrt( - Math.pow(Math.abs(new_part.transform.x - hud.x), 2) + - Math.pow(Math.abs(new_part.transform.y - hud.y), 2), + Math.pow(Math.abs(new_part.transform.x/10 - hud.x), 2) + + Math.pow(Math.abs(new_part.transform.y/10 - hud.y), 2), ), ).toString(); hud.next_poll = 30; - hud.x = new_part.transform.x; - hud.y = new_part.transform.y; + hud.x = new_part.transform.x/10; + hud.y = new_part.transform.y/10; - //x_pos!.innerText = Math.round(new_part.transform.x).toString(); - //y_pos!.innerText = Math.round(new_part.transform.y).toString(); + x_pos!.innerText = Math.round(new_part.transform.x/10).toString(); + y_pos!.innerText = Math.round(new_part.transform.y/10).toString(); } hud.next_poll--; } diff --git a/starkingdoms-client/src/pages/Play.svelte b/starkingdoms-client/src/pages/Play.svelte index 362ab5ff5e48167441ff9af8d27373a6200726d6..990ad10a49030bfc59f122c9d8aa68f23cf10746 100644 --- a/starkingdoms-client/src/pages/Play.svelte +++ b/starkingdoms-client/src/pages/Play.svelte @@ -132,7 +132,7 @@ - -- + -- , --