fffiloni commited on
Commit
a74a68a
·
1 Parent(s): 04dbc07

Update public/sketch.js

Browse files
Files changed (1) hide show
  1. public/sketch.js +13 -21
public/sketch.js CHANGED
@@ -24,19 +24,13 @@ function preload(){
24
  console.log(socket.id); // x8WIv7-mJelg7on_ALbx
25
 
26
  });
 
27
  socket.on("hello", (arg) => {
28
- //console.log(arg)
29
  space_uri = arg[0];
30
  hf_tkn = arg[1];
31
- console.log(space_uri)
32
 
33
  grAPI = new GRAPI(space_uri, hf_tkn);
34
- //setTimeout(function(){
35
- // for (let i = 0; i < AS.initial_frame_nb; i++) {
36
- // AS.create_new_frame();
37
- // AS.display_frame(0);
38
- // }
39
- //}, 1000)
40
 
41
  });
42
  }
@@ -53,14 +47,21 @@ function setup() {
53
  Draws = new DrawHandler();
54
  AS = new AnimSys(12, 12, 30, 8);
55
 
56
- // for (let i = 0; i < AS.initial_frame_nb; i++) {
57
- // AS.create_new_frame();
58
- // AS.display_frame(0);
59
- // }
 
 
 
 
 
 
60
 
61
  canvas.mousePressed(function(){
62
  Draws.startPath();
63
  });
 
64
  canvas.mouseReleased(function(){
65
  Draws.endPath(Draws.drawGraphic, AS.frameGraphics);
66
  Draws.drawings = [];
@@ -68,15 +69,6 @@ function setup() {
68
  });
69
 
70
 
71
- Cursor = new OrientedCursor('canvas');
72
- Cursor.catchCursor();
73
- Pencil = new BrushPoint('pencil', 0, 0);
74
- brushesPoints.push(Pencil);
75
-
76
-
77
-
78
-
79
-
80
  } // END SETUP
81
 
82
 
 
24
  console.log(socket.id); // x8WIv7-mJelg7on_ALbx
25
 
26
  });
27
+
28
  socket.on("hello", (arg) => {
29
+
30
  space_uri = arg[0];
31
  hf_tkn = arg[1];
 
32
 
33
  grAPI = new GRAPI(space_uri, hf_tkn);
 
 
 
 
 
 
34
 
35
  });
36
  }
 
47
  Draws = new DrawHandler();
48
  AS = new AnimSys(12, 12, 30, 8);
49
 
50
+ for (let i = 0; i < AS.initial_frame_nb; i++) {
51
+ AS.create_new_frame();
52
+ AS.display_frame(0);
53
+ }
54
+
55
+ Cursor = new OrientedCursor('canvas');
56
+ Cursor.catchCursor();
57
+
58
+ Pencil = new BrushPoint('pencil', 0, 0);
59
+ brushesPoints.push(Pencil);
60
 
61
  canvas.mousePressed(function(){
62
  Draws.startPath();
63
  });
64
+
65
  canvas.mouseReleased(function(){
66
  Draws.endPath(Draws.drawGraphic, AS.frameGraphics);
67
  Draws.drawings = [];
 
69
  });
70
 
71
 
 
 
 
 
 
 
 
 
 
72
  } // END SETUP
73
 
74