-
Notifications
You must be signed in to change notification settings - Fork 0
/
SuckerMods.pde
151 lines (128 loc) · 3.33 KB
/
SuckerMods.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
// We first implement 4 different species of Sucker
// low fre
public class LFSucker extends Sucker {
PShape body;
private void setConstrAttrs() {
setSize(80);
setOrigSize(80);
setSpd(100);
setOrigSpd(100);
setAggr(int(randomGaussian() * 10 + 10));
setLbdo(int(randomGaussian() * 10 - 10));
body = loadShape("bac0.svg");
}
public LFSucker(float hp) {
super(0, hp);
setConstrAttrs();
}
public LFSucker(float hp, int x, int y) {
super(0, hp, x, y);
setConstrAttrs();
}
public void draw() {
body.disableStyle(); // Ignore the colors in the SVG
int[] clr = clr();
stroke(clr[0], clr[1], clr[2]);
fill(clr[0], clr[1], clr[2]);
int size = getSize();
//ellipse(x(), y(), size, size);
shape(body, x()-size/2, y()-size/2, size, size);
}
public void reloadAttrs() {
setSize(int(origSize() * hp()/(START_HP)));
setSpd(int(origSpd() * hp()/(START_HP)));
}
}
public class MLSucker extends Sucker {
PShape body;
private void setConstrAttrs() {
setSize(60);
setOrigSize(60);
setSpd(100);
setOrigSpd(100);
setAggr(int(randomGaussian() * 10 + 5));
setLbdo(int(randomGaussian() * 10 - 5));
body = loadShape("bac1.svg");
}
public MLSucker(float hp) {
super(1, hp);
setConstrAttrs();
}
public MLSucker(float hp, int x, int y) {
super(1, hp, x, y);
setConstrAttrs();
}
public void draw() {
body.disableStyle();
int[] clr = clr();
stroke(clr[0], clr[1], clr[2]);
fill(clr[0], clr[1], clr[2]);
int size = getSize();
//ellipse(x(), y(), size, size);
shape(body, x()-size/2, y()-size/2, size, size);
}
public void reloadAttrs() {
setSize(int(origSize() * hp()/(START_HP)));
}
}
public class MHSucker extends Sucker {
PShape body;
private void setConstrAttrs() {
setSize(40);
setOrigSize(40);
setSpd(100);
setOrigSpd(100);
setAggr(int(randomGaussian() * 10 - 5));
setLbdo(int(randomGaussian() * 10 + 5));
body = loadShape("bac2.svg");
}
public MHSucker(float hp) {
super(2, hp);
setConstrAttrs();
}
public MHSucker(float hp, int x, int y) {
super(2, hp, x, y);
setConstrAttrs();
}
public void draw() {
body.disableStyle();
int[] clr = clr();
stroke(clr[0], clr[1], clr[2]);
fill(clr[0], clr[1], clr[2]);
int size = getSize();
//rect(x() - size/2.0, y() - size/2.0, size, size);
shape(body, x()-size/2, y()-size/2, size, size);
}
public void reloadAttrs() {
setSpd(int(origSpd() * hp()/(START_HP)));
}
}
public class HFSucker extends Sucker {
private void setConstrAttrs() {
setSize(20);
setOrigSize(20);
setSpd(80);
setOrigSpd(80);
setAggr(int(randomGaussian() * 10 - 10));
setLbdo(int(randomGaussian() * 10 + 20));
}
public HFSucker(float hp) {
super(3, hp);
setConstrAttrs();
}
public HFSucker(float hp, int x, int y) {
super(3, hp, x, y);
setConstrAttrs();
}
public void draw() {
int[] clr = clr();
stroke(clr[0], clr[1], clr[2]);
fill(clr[0], clr[1], clr[2]);
int size = getSize();
ellipse(x() - size/2.0, y() - size/2.0, size, size);
//shape(body, x()-size/2, y()-size/2, size, size);
}
public void reloadAttrs() {
setSpd(int(origSpd() * hp()/(START_HP)));
}
}