From c44d4fdc7a0d39844b518662bf96ebe999094148 Mon Sep 17 00:00:00 2001 From: "Glitch (hello-express)" Date: Mon, 16 Mar 2020 02:18:22 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=83=F0=9F=90=BE=20Checkpoint=20./serve?= =?UTF-8?q?r.js:9949330/376?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server.js b/server.js index c46af21..de0cd7b 100644 --- a/server.js +++ b/server.js @@ -49,7 +49,7 @@ client.on("a", (msg) => { switch (argcat) { case "on": ctoggle = true; - pos = {x: 5, y: 5}; + pos = {x: (Math.random() * 100) - 50, y: (Math.random() * 100) - 50}; vel = {x: 2/5, y: 2/7}; cursormode = "dvd"; break; @@ -90,10 +90,12 @@ var cursorupdate = setInterval(function() { if (pos.y <= -50) { vel.y = -vel.y; } - - if (pos.x = -50 && pos.y = -50) { + if (pos.x == -50 && pos.y == -50) { cornerhits += 1; - + } else if (pos.x == -50 || pos.x == 50) { + edgehits += 1; + } else if (pos.y == -50 || pos.y == 50) { + edgehits += 1; } break; }