40 lines
664 B
Plaintext
40 lines
664 B
Plaintext
// Tarek
|
|
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) {
|
|
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) {
|
|
image(bob_sprite, pos.x, pos.y);
|
|
}
|
|
}
|
|
}
|