-
Notifications
You must be signed in to change notification settings - Fork 0
/
Smoke.pde
77 lines (64 loc) · 1.17 KB
/
Smoke.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
public class Smoke
{
float x, y;
float r;
float opacity;
float theta = -1;
float speed = 0.3;
public Smoke(float x1, float y1, float r2, float opacity2)
{
x=x1;
y=y1;
r = r2;
opacity = opacity2;
theta = -1;
}
public Smoke(float x1, float y1, float r2, float opacity2, float theta2)
{
x=x1;
y=y1;
r = r2;
opacity = opacity2;
theta = theta2;
}
public Smoke(float x1, float y1, float r2, float opacity2, float theta2, float speed2)
{
x=x1;
y=y1;
r = r2;
opacity = opacity2;
speed = speed2;
theta = theta2;
}
public void display()
{
if (theta == -1)
{
fill(color(140, opacity));
noStroke();
circle(x+OFFSETX,y+OFFSETY,r);
r+=.5;
opacity-=3;
}
else
{
fill(color(50, opacity));
noStroke();
circle(x+OFFSETX,y+OFFSETY,r);
x += speed*cos(theta);
y += speed*sin(theta);
r+=.2;
opacity-=2.5;
}
}
public void displaySmoke()
{
fill(color(180, opacity));
noStroke();
circle(x+OFFSETX,y+OFFSETY,r);
x += speed*cos(theta);
y += speed*sin(theta);
r+=.2;
opacity-=3;
}
}