-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLevelAfghan.pde
54 lines (46 loc) · 1.34 KB
/
LevelAfghan.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
52
53
54
class LevelAfghan extends Level {
LevelAfghan() {
super();
gunWorking = true;
allowItems = true;
dropItems = true;
}
void setupLevel() {
backgroundColour = color(219, 197, 106);
showHUD = true;
allowItems = true;
gunWorking = true;
for (int i = 0; i < 10; ++i) {
emus.add(new AfghanEmu(random(width*.75, width), random(300, height-300), random(0.1, 0.4)));
}
guns.add(new Gun_M60(200));
for (Gun g : guns) {
g.setAmmo(g.getMaxAmmo());
}
for (int i = 0; i < 30; i++) {
decorations.add(new Decor(int(random(0, width)), int(random(0, height)), random(0.2, 0.4), false, bushImages[floor(random(0, bushImages.length))]));
}
//sets xpos, ypos, heading, speed, HP, and maxSpeec, and items in inventory, as well as music
truck.setX(200);
truck.setY(200);
truck.setHeading(PI);
truck.setSpeed(0);
truck.setHP(1);
truck.resetMaxSpeed();
inventory.put("Boomerang", 0);
inventory.put("Vegemite", 0);
inventory.put("Grenade", 0);
inventory.put("Landmine", 10);
inventory.put("Gas", 0);
nasheed.rewind();
nasheed.loop(5);
scene = 4;
}
void update() {
track = true;
super.update();
/*if (emusAlive() < 30) {
emus.add(new VietEmu(random(width*.75, width), random(300, height-300), random(0.1, 0.4)));
}*/
}
}