-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2Ready.js
42 lines (33 loc) · 1.05 KB
/
2Ready.js
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
class Ready {
constructor() {
this.size = 30;
this.length = 100;
this.center = createVector(width / 2, height);
this.angle = 90;
this.angleStep = 3;
this.pos = createVector();
this.actualPos = createVector();
}
move() {
this.angle += this.angleStep;
if (this.angle >= 150 || this.angle <= 30) {
this.angleStep *= -1;
}
this.pos.set(this.length * cos(this.angle), -this.length * sin(this.angle));
this.actualPos = this.center.copy().add(this.pos);
}
draw() {
stroke(255, 189, 233);
fill(255, 189, 233);
line(this.center.x, this.center.y, this.actualPos.x, this.actualPos.y);
ellipse(this.actualPos.x, this.actualPos.y, this.size, this.size);
ellipse(this.center.x, this.center.y, this.length * 1, this.length * 0.8);
}
// times() {
// fill(0);
// textFont('Orbitron');
// textAlign(CENTER, CENTER);
// textSize(28);
// text(times, 290, 583, 30);
// }
}