~starkingdoms/starkingdoms

24835217e4844429af6f9cb63192e76c9440ca31 — ghostlyzsh 1 year, 8 months ago e0fddea
i guess something changed?
1 files changed, 26 insertions(+), 6 deletions(-)

M starkingdoms-client/src/pages/ShipEditor.svelte
M starkingdoms-client/src/pages/ShipEditor.svelte => starkingdoms-client/src/pages/ShipEditor.svelte +26 -6
@@ 165,7 165,7 @@
        let img = textures.get(selected!)!;
        ctx.save();
        ctx.translate(canvas_x + grid_size / 2, canvas_y + grid_size / 2);
        ctx.rotate(((rotation+2) * Math.PI) / 2);
        ctx.rotate(((rotation + 2) * Math.PI) / 2);
        ctx.globalAlpha = 0.2;
        ctx.drawImage(
          img,


@@ 211,7 211,7 @@

        ctx.save();
        ctx.translate(canvas_x + grid_size / 2, canvas_y + grid_size / 2);
        ctx.rotate(((rotation+2) * Math.PI) / 2);
        ctx.rotate(((rotation + 2) * Math.PI) / 2);
        ctx.drawImage(
          img,
          -grid_size / 2,


@@ 270,19 270,39 @@

    if (children[0] !== null) {
      let rotation_next = (rotation + 2) % 4;
      place(x + x_dir[rotation_next], y + y_dir[rotation_next], children[0], rotation_next);
      place(
        x + x_dir[rotation_next],
        y + y_dir[rotation_next],
        children[0],
        rotation_next,
      );
    }
    if (children[1] !== null) {
      let rotation_next = (rotation + 1) % 4;
      place(x + x_dir[rotation_next], y + y_dir[rotation_next], children[1], rotation_next);
      place(
        x + x_dir[rotation_next],
        y + y_dir[rotation_next],
        children[1],
        rotation_next,
      );
    }
    if (children[2] !== null) {
      let rotation_next = (rotation + 0) % 4;
      place(x + x_dir[rotation_next], y + y_dir[rotation_next], children[2], rotation_next);
      place(
        x + x_dir[rotation_next],
        y + y_dir[rotation_next],
        children[2],
        rotation_next,
      );
    }
    if (children[3] !== null) {
      let rotation_next = (rotation + 3) % 4;
      place(x + x_dir[rotation_next], y + y_dir[rotation_next], children[3], rotation_next);
      place(
        x + x_dir[rotation_next],
        y + y_dir[rotation_next],
        children[3],
        rotation_next,
      );
    }
  }