🌦✂️ Checkpoint

./server.js:9949330/666
This commit is contained in:
Glitch (hello-express) 2020-03-11 20:06:20 +00:00
parent c47d37f7a4
commit 5e0008964d
1 changed files with 13 additions and 9 deletions

View File

@ -40,17 +40,25 @@ client.on("a", (msg) => {
break;
case "dvd!cursor":
if (!argcat || argcat == "") {
chat("Modes: on // off");
chat("Modes: on // off // frantic");
} else {
switch (argcat) {
case "on":
ctoggle = true;
pos = {x: 5, y: 5};
vel = {x: 2/5, y: 2/7};
cursormode = "dvd";
break;
case "off":
ctoggle = false;
cursormode = "none";
pos = {x: -500, y: -500};
break;
case "frantic":
ctoggle = true;
pos = {x: 5, y: 5};
vel = {x: 10, y: 15};
cursormode = "frantic";
break;
}
}
@ -62,17 +70,13 @@ var pos = {x: -42, y: 5};
var vel = {x: 2/5, y: 2/7};
var cursor = setInterval(function() {
if (ctoggle == true) {
client.sendArray([{m:'m', x: client.getOwnParticipant().x = pos.x + 50, y: client.getOwnParticipant().y = pos.y + 50}])
} else {
pos.x = -150;
pos.y = -150;
}
client.sendArray([{m:'m', x: client.getOwnParticipant().x = pos.x + 50, y: client.getOwnParticipant().y = pos.y + 50}]);
});
var cursorupdate = setInterval(function() {
switch (cursormode) {
case "dvd":
case "frantic":
pos.x += vel.x;
pos.y += vel.y;
if (pos.x >= 50) {
@ -88,7 +92,7 @@ var cursorupdate = setInterval(function() {
vel.y = -vel.y;
}
break;
case "off":
}
}, 25);