-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLevelVietnam.pde
51 lines (44 loc) · 1.29 KB
/
LevelVietnam.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 LevelVietnam extends Level {
LevelVietnam() {
super();
dropItems = true;
}
void setupLevel() {
backgroundColour = color(19, 110, 0);
showHUD = true;
gunWorking = true;
allowItems = true;
for (int i = 0; i < 30; ++i) {
emus.add(new VietEmu(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 < 20; i++) {
decorations.add(new Decor(int(random(width-600, width)), int(random(0, height)), random(0.4, 0.6), false, jungleImages[floor(random(0, jungleImages.length))]));
}
//sets xpos, ypos, heading, speed, HP, and maxSpeec, and items in inventory
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", 3);
inventory.put("Landmine", 3);
inventory.put("Gas", 0);
fortunateson.rewind();
fortunateson.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)));
}
}
}