@adatechnology/game-test-room 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36783,6 +36783,9 @@ void main(){
36783
36783
  const blocked = (x, z) => {
36784
36784
  if (Math.abs(x) > o.limit - PLAYER_RADIUS || Math.abs(z) > o.limit - PLAYER_RADIUS) return true;
36785
36785
  for (const c of o.colliders) if (x > c[0] - PLAYER_RADIUS && x < c[2] + PLAYER_RADIUS && z > c[1] - PLAYER_RADIUS && z < c[3] + PLAYER_RADIUS) return true;
36786
+ if (o.blockers) {
36787
+ for (const blocked2 of o.blockers) if (blocked2(x, z, PLAYER_RADIUS)) return true;
36788
+ }
36786
36789
  return false;
36787
36790
  };
36788
36791
  const move = (dx, dz) => {
@@ -38431,10 +38434,12 @@ void main(){
38431
38434
  log.setBeforeRead(flush);
38432
38435
  let useHeld = false;
38433
38436
  let useFirst = false;
38437
+ const blockers = /* @__PURE__ */ new Set();
38434
38438
  const player = createPlayer(THREE, {
38435
38439
  camera: camera2,
38436
38440
  dom,
38437
38441
  colliders: arena.colliders,
38442
+ blockers,
38438
38443
  limit: arenaSize,
38439
38444
  start: arena.playerStart,
38440
38445
  hooks: {
@@ -38617,8 +38622,10 @@ void main(){
38617
38622
  film.clear();
38618
38623
  fluids.setTap(TAP_ID, false);
38619
38624
  };
38625
+ const clearListeners = /* @__PURE__ */ new Set();
38620
38626
  const clear = () => {
38621
38627
  clearEverything();
38628
+ for (const listener of [...clearListeners]) listener();
38622
38629
  restingTops.length = 0;
38623
38630
  pending = [];
38624
38631
  action("clear", t("act.clear"));
@@ -39817,6 +39824,14 @@ void main(){
39817
39824
  },
39818
39825
  log(text, data) {
39819
39826
  action("module_note", text, { data });
39827
+ },
39828
+ addBlocker(blocked) {
39829
+ blockers.add(blocked);
39830
+ return () => blockers.delete(blocked);
39831
+ },
39832
+ onClear(listener) {
39833
+ clearListeners.add(listener);
39834
+ return () => clearListeners.delete(listener);
39820
39835
  }
39821
39836
  };
39822
39837
  const lendBench = (store) => ({