xxxxxxxxxx
const waitress = io.connect(':30000?sketch=1047493');
let users;
let maxPoints;
function setup() {
createCanvas(windowWidth, windowHeight);
background(255);
users = [{name: "Dummy", points: 0}];
maxPoints = [0, 0];
}
function draw() {
textAlign(CENTER, CENTER);
fill(0);
textSize(70);
text("Waitress Game Points", width/2, height/2);
users.forEach((user, index) => {
if(user.points > maxPoints[0]) {
maxPoints[0] = user.points;
maxPoints[1] = index;
}
});
textSize(20);
text(users[maxPoints[1]].name + " is in the lead!", width/2, height*3/4);
maxPoints = [0, 0];
}
var socket = io.connect($OP.getEchoServerURL(1047493));
Learn more See an example