~starkingdoms/starkingdoms

b0135112eaede4fc1ddc42ce812b02852fadab04 — ghostlyzsh 1 year, 11 months ago 64ed56f
position is back and divided by 10 now
3 files changed, 13 insertions(+), 9 deletions(-)

M server/src/main.rs
M starkingdoms-client/src/hub.ts
M starkingdoms-client/src/pages/Play.svelte
M server/src/main.rs => server/src/main.rs +6 -2
@@ 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.,
                        )));
                })

M starkingdoms-client/src/hub.ts => starkingdoms-client/src/hub.ts +6 -6
@@ 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--;
          }

M starkingdoms-client/src/pages/Play.svelte => starkingdoms-client/src/pages/Play.svelte +1 -1
@@ 132,7 132,7 @@
      <tbody>
        <tr>
          <td id="pos">
            <span id="pos-val-x" bind:this={y_pos}>--</span>
            <span id="pos-val-x" bind:this={x_pos}>--</span>
            ,
            <span id="pos-val-y" bind:this={y_pos}>--</span>
          </td>