Quellcode durchsuchen

done with these ifs and loops

Whitney Martinez vor 6 Jahren
Ursprung
Commit
107aa27470
2 geänderte Dateien mit 23 neuen und 10 gelöschten Zeilen
  1. 17
    4
      WriteIFs.java
  2. 6
    6
      package.bluej

+ 17
- 4
WriteIFs.java Datei anzeigen

@@ -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
 

+ 6
- 6
package.bluej Datei anzeigen

@@ -5,18 +5,18 @@ dependency1.type=UsesDependency
5 5
 dependency2.from=WriteLoopsTest
6 6
 dependency2.to=WriteLoops
7 7
 dependency2.type=UsesDependency
8
-editor.fx.0.height=712
9
-editor.fx.0.width=1057
10
-editor.fx.0.x=401
11
-editor.fx.0.y=-987
8
+editor.fx.0.height=709
9
+editor.fx.0.width=800
10
+editor.fx.0.x=345
11
+editor.fx.0.y=23
12 12
 objectbench.height=83
13 13
 objectbench.width=324
14 14
 package.divider.horizontal=0.6007259528130672
15 15
 package.divider.vertical=0.8617511520737328
16 16
 package.editor.height=554
17 17
 package.editor.width=445
18
-package.editor.x=-74
19
-package.editor.y=-1025
18
+package.editor.x=10
19
+package.editor.y=23
20 20
 package.frame.height=709
21 21
 package.frame.width=571
22 22
 package.numDependencies=2