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