44 lines
746 B
Plaintext
44 lines
746 B
Plaintext
class Collectable {
|
|
float x, y, cwidth, cheight;
|
|
boolean is_attached = false;
|
|
|
|
Collectable(float xpos, float ypos, float cw, float ch) {
|
|
x = xpos;
|
|
y = ypos;
|
|
cwidth = cw;
|
|
cheight = ch;
|
|
}
|
|
}
|
|
|
|
class Saw extends Collectable {
|
|
|
|
Saw(float x, float y, float cw, float ch) {
|
|
super(x, y, cw, ch);
|
|
}
|
|
|
|
void drawSaw() {
|
|
if (!is_attached) {
|
|
stroke(0);
|
|
fill(210, 210, 0);
|
|
rect(x, y, cwidth, cheight);
|
|
fill(0);
|
|
}
|
|
}
|
|
}
|
|
|
|
class Bob extends Collectable {
|
|
|
|
Bob(float x, float y, float cw, float ch) {
|
|
super(x, y, cw, ch);
|
|
}
|
|
|
|
void drawBob() {
|
|
if (!is_attached) {
|
|
stroke(0);
|
|
fill(255, 209, 152);
|
|
rect(x, y, cwidth, cheight);
|
|
fill(0);
|
|
}
|
|
}
|
|
}
|