-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLevelThree.pde
67 lines (58 loc) · 2.08 KB
/
LevelThree.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
55
56
57
58
59
60
61
62
63
64
65
66
67
class LevelThree extends Level {
//String[] textScene = new String[3];
LevelThree() {
super();
showHUD = false;
allowItems = false;
dropItems = false;
}
void setupLevel() {
for (int i = 0; i < 200; ++i) {
emus.add(new StaticEmu(random(width*.75, width), random(300, height-300), 0.3));
}
guns.add(new Gun_Lewisgun(75));
for (Gun g : guns) {
g.setAmmo(g.getMaxAmmo());
}
allowItems = false;
gunWorking = true;
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
truck.setX(0);
truck.setY(height/2);
truck.setHeading(PI*0.5);
truck.setSpeed(0);
truck.setHP(1);
truck.resetMaxSpeed();
inventory.put("Boomerang", 5);
inventory.put("Vegemite", 3);
inventory.put("Grenade", 10);
inventory.put("Landmine", 10);
inventory.put("Gas", 10);
textScene[0] = "November 4, 1932 \n \n \nMajor G.P.W Meredith,\n \nWe've received reports that a massive herd has been spotted near the dam. \nWe want you to wait near the dam and ambush them.\n\nYou'll have a pickup truck and a mounted Lewis light machine gun.\n \n \nGood luck,\nPrime Minister Lyons";
endScene[0] = "Operation Update - November 4, 1932 \n \n \nWe were able to kill about a dozen birds, but then our gun jammed. \nBefore we could the gun fixed, they all managed to escape.\n\nThey scattered in every direction, and are more spread out than before.\n\n\n- Major G.P.W Meredith";
}
void update() {
super.update();
if (emusAlive() < 186) {
group = false;
gunWorking = false;
for (Emu e : emus) {
e.setLeaving(true);
}
endTimer++;
if (!levelEnded) {
fill(0, endTimer/3);
rect(width/2, height/2, width, height);
}
if (endTimer > 700) {
if (getLevelData() < 3) {
setLevelData(3);
}
levelEnded = true;
}
}
}
}