|
@@ -15,16 +15,29 @@ public class WriteIFs
|
15
|
15
|
|
16
|
16
|
public void playerDied(boolean player1) {
|
17
|
17
|
// Write an IF statement that checks “player1.isAlive()”
|
18
|
|
- // and if that’s false, calls “displayGameOver(player1)”
|
19
|
|
- if(player1 == true){
|
20
|
|
-
|
21
|
|
- playerDied(false);
|
|
18
|
+ // and if that’s false, calls “displayGameOver(player1)”
|
|
19
|
+ if(player1 == false){
|
22
|
20
|
|
|
21
|
+
|
|
22
|
+ playerDied(true);
|
|
23
|
+ displayGameOver(player1);
|
23
|
24
|
|
24
|
25
|
}else{
|
|
26
|
+ playerDied(false);
|
|
27
|
+
|
|
28
|
+ }
|
|
29
|
+ /*
|
|
30
|
+ if(!isAlive(player1)){
|
25
|
31
|
|
|
32
|
+
|
26
|
33
|
displayGameOver(player1);
|
|
34
|
+
|
|
35
|
+ }else{
|
|
36
|
+ playerDied(true);
|
|
37
|
+
|
27
|
38
|
}
|
|
39
|
+
|
|
40
|
+ */
|
28
|
41
|
|
29
|
42
|
}
|
30
|
43
|
|