Update public/sketch.js
Browse files- public/sketch.js +15 -18
public/sketch.js
CHANGED
@@ -17,22 +17,6 @@ let hf_tkn;
|
|
17 |
//-----------------------------------------------------
|
18 |
//-----------------------------------------------------
|
19 |
|
20 |
-
function preload() {
|
21 |
-
|
22 |
-
const socket = io();
|
23 |
-
// client-side
|
24 |
-
socket.on("connect", () => {
|
25 |
-
console.log(socket.id); // x8WIv7-mJelg7on_ALbx
|
26 |
-
socket.on("hello", (arg) => {
|
27 |
-
console.log(arg[0])
|
28 |
-
space_uri = arg[0];
|
29 |
-
hf_tkn = arg[1];
|
30 |
-
grAPI = new GRAPI(space_uri, hf_tkn);
|
31 |
-
Draws = new DrawHandler();
|
32 |
-
AS = new AnimSys(12, 12, 30, 8);
|
33 |
-
});
|
34 |
-
});
|
35 |
-
}
|
36 |
|
37 |
function setup() {
|
38 |
|
@@ -44,8 +28,21 @@ function setup() {
|
|
44 |
pixelDensity(1);
|
45 |
background('white');
|
46 |
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
for (let i = 0; i < AS.initial_frame_nb; i++) {
|
51 |
AS.create_new_frame();
|
|
|
17 |
//-----------------------------------------------------
|
18 |
//-----------------------------------------------------
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
function setup() {
|
22 |
|
|
|
28 |
pixelDensity(1);
|
29 |
background('white');
|
30 |
|
31 |
+
const socket = io();
|
32 |
+
// client-side
|
33 |
+
socket.on("connect", () => {
|
34 |
+
console.log(socket.id); // x8WIv7-mJelg7on_ALbx
|
35 |
+
socket.on("hello", (arg) => {
|
36 |
+
console.log(arg[0])
|
37 |
+
space_uri = arg[0];
|
38 |
+
hf_tkn = arg[1];
|
39 |
+
|
40 |
+
});
|
41 |
+
});
|
42 |
+
|
43 |
+
grAPI = new GRAPI(space_uri, hf_tkn);
|
44 |
+
Draws = new DrawHandler();
|
45 |
+
AS = new AnimSys(12, 12, 30, 8);
|
46 |
|
47 |
for (let i = 0; i < AS.initial_frame_nb; i++) {
|
48 |
AS.create_new_frame();
|