Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions code_sockets/public/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
var socket;

function setup() {
createCanvas(200, 200);
createCanvas(400, 400);
background(0);
// Start a socket connection to the server
// Some day we would run this server somewhere else
Expand All @@ -20,7 +20,7 @@ function setup() {
// Draw a blue circle
fill(0,0,255);
noStroke();
ellipse(data.x, data.y, 80, 80);
ellipse(data.x, data.y, 20, 20);
}
);
}
Expand All @@ -33,7 +33,7 @@ function mouseDragged() {
// Draw some white circles
fill(255);
noStroke();
ellipse(mouseX,mouseY,80,80);
ellipse(mouseX,mouseY,20,20);
// Send the mouse coordinates
sendmouse(mouseX,mouseY);
}
Expand All @@ -51,4 +51,4 @@ function sendmouse(xpos, ypos) {

// Send that object to the socket
socket.emit('mouse',data);
}
}