-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLevelTwo.pde
68 lines (59 loc) · 2.06 KB
/
LevelTwo.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
68
class LevelTwo extends Level {
//String[] textScene = new String[3];
LevelTwo() {
super();
showHUD = false;
allowItems = false;
dropItems = false;
}
void setupLevel() {
for (int i = 0; i < 40; ++i) {
emus.add(new BasicEmu(random(width*.75, width), random(300, height-300), random(0.1, 0.4)));
}
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(200);
truck.setY(200);
truck.setHeading(PI);
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 2, 1932 \n \n \nMajor G.P.W Meredith,\n \nThe rain has ceased, and some 50 emus have been spotted near Campon. \n\nHead out there and try again. \n \n \nGood luck,\nPrime Minister Lyons";
endScene[0] = "Operation Update - October 30, 1932 \n \n \nAs soon as we opened fire, the birds started to split into smaller groups.\nWe were able to kill a number of birds with the machine guns, even in their small groups.\n\nHowever, they began to run away, and got out of range from our guns.\n\n\n - Major G.P.W Meredith";
truckWorking = true;
}
void update() {
super.update();
if (emusAlive() < 27) {
group = false;
keepEmusOnScreen = 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() < 2) {
setLevelData(2);
}
levelEnded = true;
}
}
}
}