-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelicopter game main.pde
47 lines (38 loc) · 980 Bytes
/
helicopter game main.pde
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
44
45
46
47
Mover m;
int counter = 0;
void setup() {
size(640, 320, P3D);
m = new Mover();
smooth(4);
}
void draw() {
noStroke();
fill(0,7);
rect(0,0,width,height);
counter++;
pushMatrix();
fill(200, 200, 200);
ellipse(m.location.x, m.location.y, 50, 30);
PVector f = new PVector(0, 0.1);
ambientLight(255, 255, 255, m.location.x, m.location.y, 0);
m.applyForce(f);
m.wind();
m.edges();
m.display();
m.update();
textSize(15);
fill(0, 0, 0);
popMatrix();
fill(255);
ellipse(random(width), random(height), 5, 5);
if (counter == 30) {
//background(50, 100, 100);
pushMatrix();
text("acceleration: " + m.acceleration.x +" " + m.acceleration.y, 10, 15);
text("velocity: " + String.format("%.2f", m.velocity.x) +" " +
String.format("%.2f", m.velocity.y), 10, 30);
text("location " + String.format("%.2f", m.location.x) + " " + String.format("%.2f", m.location.y), 10, 45);
popMatrix();
counter = 0;
}
}