-
Notifications
You must be signed in to change notification settings - Fork 115
Expand file tree
/
Copy pathliveSketch.js
More file actions
42 lines (35 loc) · 893 Bytes
/
liveSketch.js
File metadata and controls
42 lines (35 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* Variables.
*
* Variables are used for storing values. In this example, change
* the values of variables to affect the composition.
*/
function runLiveSketch(s) {
s.setup = () => {
s.createCanvas(640, 360);
s.background(0);
s.stroke(153);
s.strokeWeight(4);
s.strokeCap(s.SQUARE);
var a = 50;
var b = 120;
var c = 180;
s.line(a, b, a + c, b);
s.line(a, b + 10, a + c, b + 10);
s.line(a, b + 20, a + c, b + 20);
s.line(a, b + 30, a + c, b + 30);
a = a + c;
b = s.height - b;
s.line(a, b, a + c, b);
s.line(a, b + 10, a + c, b + 10);
s.line(a, b + 20, a + c, b + 20);
s.line(a, b + 30, a + c, b + 30);
a = a + c;
b = s.height - b;
s.line(a, b, a + c, b);
s.line(a, b + 10, a + c, b + 10);
s.line(a, b + 20, a + c, b + 20);
s.line(a, b + 30, a + c, b + 30);
s.noLoop();
};
}