47 lines
897 B
Plaintext
47 lines
897 B
Plaintext
class Collectable {
|
|
float cwidth, cheight;
|
|
boolean is_attached = false;
|
|
PVector pos = new PVector();
|
|
|
|
Collectable(float xpos, float ypos, float cw, float ch) {
|
|
pos.x = xpos;
|
|
pos.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(pos.x, pos.y, cwidth, cheight);
|
|
// fill(0);
|
|
image(saw_sprite, pos.x, pos.y);
|
|
}
|
|
}
|
|
}
|
|
|
|
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(pos.x, pos.y, cwidth, cheight);
|
|
// fill(0);
|
|
image(bob_sprite, pos.x, pos.y);
|
|
}
|
|
}
|
|
}
|