Преглед изворни кода

done with these ifs and loops

Whitney Martinez пре 6 година
родитељ
комит
107aa27470
2 измењених фајлова са 23 додато и 10 уклоњено
  1. 17
    4
      WriteIFs.java
  2. 6
    6
      package.bluej

+ 17
- 4
WriteIFs.java Прегледај датотеку

15
 
15
 
16
     public void playerDied(boolean player1) {
16
     public void playerDied(boolean player1) {
17
         // Write an IF statement that checks “player1.isAlive()” 
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
         }else{
25
         }else{
26
+            playerDied(false);
27
+            
28
+        }
29
+        /*
30
+        if(!isAlive(player1)){
25
 
31
 
32
+            
26
             displayGameOver(player1);
33
             displayGameOver(player1);
34
+     
35
+        }else{
36
+            playerDied(true);
37
+            
27
         }
38
         }
39
+        
40
+       */
28
 
41
 
29
     }
42
     }
30
 
43
 

+ 6
- 6
package.bluej Прегледај датотеку

5
 dependency2.from=WriteLoopsTest
5
 dependency2.from=WriteLoopsTest
6
 dependency2.to=WriteLoops
6
 dependency2.to=WriteLoops
7
 dependency2.type=UsesDependency
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
 objectbench.height=83
12
 objectbench.height=83
13
 objectbench.width=324
13
 objectbench.width=324
14
 package.divider.horizontal=0.6007259528130672
14
 package.divider.horizontal=0.6007259528130672
15
 package.divider.vertical=0.8617511520737328
15
 package.divider.vertical=0.8617511520737328
16
 package.editor.height=554
16
 package.editor.height=554
17
 package.editor.width=445
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
 package.frame.height=709
20
 package.frame.height=709
21
 package.frame.width=571
21
 package.frame.width=571
22
 package.numDependencies=2
22
 package.numDependencies=2