-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzzEnd.ino
More file actions
36 lines (33 loc) · 1015 Bytes
/
zzEnd.ino
File metadata and controls
36 lines (33 loc) · 1015 Bytes
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
String endCiv = "";
int Score;
bool alive = true;
void endGame()
{
// Check if we're still alive, or if everyone died in agony
if(!gameOver)
{
gameOver = true;
if(planet_Temp > 300)
alive = false;
else if(planet_Temp > 120 && ((construction < 50 && supplies < 25) || construction < 25))
alive = false;
else if(planet_Temp < 0 && construction < 25)
alive = false;
else if(planet_Resources < 2)
alive = false;
else if(planet_Gravity > 3)
alive = false;
else if((planet_Water < 1 && construction < 25) || (planet_Water < 1 && construction < 50 && supplies < 25))
alive = false;
else if((planet_Atmosphere != 2 && construction < 25) || (planet_Atmosphere != 2 && construction < 50 && supplies < 25))
alive = false;
}
//Let the player know if they lived or died
lcd.setCursor(0,1);
lcd.print(" ");
lcd.setCursor(0,0);
if(alive)
lcd.print("COLONY SUCCESS! ");
else
lcd.print("EVERYBODY DIED! ");
}