-
Notifications
You must be signed in to change notification settings - Fork 0
/
Map.pde
51 lines (43 loc) · 1.15 KB
/
Map.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
class Map implements IMap {
PVector pos, size;
void create(String filepath) {
walls.clear();
String[] source = loadStrings(filepath);
for (String line : source) {
String[] args = line.split(" ");
switch(args[0]) {
case "wall":
pos = new PVector(float(args[1]), float(args[2]));
size = new PVector(float(args[3]), float(args[4]));
walls.add(new Wall() {
{
pos = Map.this.pos;
size = Map.this.size;
create();
}
}
);
break;
case "spawn":
pos = new PVector(float(args[1]), float(args[2]));
player = new Player() {
{
pos = Map.this.pos;
vel = new PVector();
speed = 300;
size = 50;
viewDist = 250;
attackDist = 175;
attackTime = 0.25;
attackTicks = attackCooldown = 1.75;
attackIndicatorSize = new PVector(300, 50);
health = maxHealth = 100;
healthBarSize = new PVector(300, 50);
hpReach = 75;
}
};
break;
}
}
}
}