From 1811385b65705b2ca946a0b10f625f5e3777fc99 Mon Sep 17 00:00:00 2001 From: onezDerv Date: Sun, 29 Sep 2024 04:06:33 -0400 Subject: [PATCH] node crypto sdgfjkl --- common/crypto.js | 1 + common/player.js | 2 +- crypto.js | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 common/crypto.js create mode 100644 crypto.js diff --git a/common/crypto.js b/common/crypto.js new file mode 100644 index 0000000..757b938 --- /dev/null +++ b/common/crypto.js @@ -0,0 +1 @@ +export default crypto; \ No newline at end of file diff --git a/common/player.js b/common/player.js index 4d57fc7..072aa45 100644 --- a/common/player.js +++ b/common/player.js @@ -1,4 +1,4 @@ -let crypto = (typeof window === 'undefined') ? await import('node:crypto') : crypto; +import crypto from "./crypto.js"; function distF(ent, target) { return ((ent.pos.x - target.pos.x) ** 2) + ((ent.pos.y - target.pos.y) ** 2) diff --git a/crypto.js b/crypto.js new file mode 100644 index 0000000..a2de468 --- /dev/null +++ b/crypto.js @@ -0,0 +1,3 @@ +import crypto from "node:crypto"; + +export default crypto; \ No newline at end of file