-
Notifications
You must be signed in to change notification settings - Fork 0
/
Camp.pde
46 lines (40 loc) · 1018 Bytes
/
Camp.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
class Camp extends Frame{
private int size;
private Player player;
Camp(PVector pos, int s, Player p) {
position = pos;
size = s;
player = p;
}
void update() {
for (Goal b : goals) {
if (b.getPosition().x > position.x - size/2.0 && b.getPosition().x < position.x + size/2.0 && b.getPosition().y > position.y - size/2.0 && b.getPosition().y < position.y + size/2.0) {
b.count();
if (b.gooal()) {
splashes.add(new Splash(b.position,3,player.farbe,10,2,25));
b.relocate();
player.score();
}
}
}
}
void show() {
strokeWeight(2);
noFill();
stroke(player.farbe);
rect(position.x-size/2.0, position.y-size/2.0+2.5, size, size,5,5,5,5);
textSize(15);
textAlign(CENTER,CENTER);
fill(player.farbe);
text(player.score,position.x,position.y);
}
PVector getPosition() {
return position.copy();
}
int getSize() {
return size;
}
Player getPlayer() {
return player;
}
}