Browse Source

added attack guard system

master
Yazan Alaamer 2 years ago
parent
commit
4ca1ad991d
  1. 23
      src/main/java/game/StartDarkSoulsGame.java

23
src/main/java/game/StartDarkSoulsGame.java

@ -177,7 +177,20 @@ public class StartDarkSoulsGame {
choice3.setText(""); choice3.setText("");
choice4.setText(""); choice4.setText("");
} }
public void attackGuard() {
position = "attackGuard";
mainTextArea.setText("Guard: I can see your soul at the edges of your eyes. "
+ "It's corrosive, like acid. \n You got a demon, little man.\n "
+ "Guard fought back with sowrd of ashina "
+ "\n(you recieve 3 damage) ");
playerHP = playerHP -3;
hpLabelNumber.setText(""+ playerHP);
choice1.setText(">");
choice2.setText("");
choice3.setText("");
choice4.setText("");
}
public class TitelScreenHandler implements ActionListener{ public class TitelScreenHandler implements ActionListener{
public void actionPerformed(ActionEvent event) { public void actionPerformed(ActionEvent event) {
@ -192,7 +205,7 @@ public class StartDarkSoulsGame {
case "townGate": case "townGate":
switch(yourChoice) { switch(yourChoice) {
case "c1": talkGuard(); break; case "c1": talkGuard(); break;
case "c2": break;
case "c2": attackGuard(); break;
case "c3": break; case "c3": break;
} }
break; break;
@ -201,6 +214,12 @@ public class StartDarkSoulsGame {
case"c1": townGate();break; case"c1": townGate();break;
} }
break; break;
case "attackGuard":// commit (26) attack guard
switch(yourChoice) {// commit (26) attack guard
case "c1": townGate();// commit (26) attack guard
break;// commit (26) attack guard
}
break;
} }
} }

Loading…
Cancel
Save