-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweek_2.js
More file actions
43 lines (37 loc) · 825 Bytes
/
week_2.js
File metadata and controls
43 lines (37 loc) · 825 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
43
const width = 125;
const height = 125;
setDocDimensions(width, height);
// store final lines here
const finalLines = [];
//bt.setRandSeed(3848);
const rad = bt.randIntInRange(10, 30);
const len = bt.randIntInRange(10, 100)
// create a polyline
drawLines([
[
[0, 10],
[125, 10]
]
])
const building = new bt.Turtle()
.jump([50, 10])
.left(90)
.forward(len)
.right(90)
.forward(rad)
.right(90)
.forward(len)
.right(90);
const bird = new bt.Turtle()
.jump([rad, len+10])
.arc(-35,8)
.right(-45)
.arc(-35,8);
const bird2 = new bt.Turtle()
.jump([rad+60, len+20])
.arc(-35,8)
.right(-45)
.arc(-35,8);
drawLines(building.lines(), {fill: "black", stroke: "red", width: "10"})
drawLines(bt.scale(bird.lines(), [4.0, 1.25]));
drawLines(bt.scale(bird2.lines(), [2.0, 8.25]));