Browse Source

refactoring: fix endless hp glitch

master
Yazan Alaamer 2 years ago
parent
commit
434c1dd96a
  1. 8
      src/main/java/game/StartDarkSoulsGame.java

8
src/main/java/game/StartDarkSoulsGame.java

@ -22,7 +22,7 @@ public class StartDarkSoulsGame {
Container con;
TitelScreenHandler tsHandler= new TitelScreenHandler();
ChoiceHandler choiceHandler = new ChoiceHandler();
int playerHP, monsterHP, AshuraRing;
int playerHP, monsterHP, AshuraRing, fill_hp;
String position, weapon;
public StartDarkSoulsGame() {
@ -195,10 +195,14 @@ public class StartDarkSoulsGame {
choice3.setText("Go south");
choice4.setText("Go West");
}
public void north() {
public void north() {
position= "north";
if (fill_hp < 1) {
mainTextArea.setText("You Are at Siofra River.\n this Water is blessed Drink it. \n (+ 2HP)");
playerHP = playerHP +2;
fill_hp++;
}
else { mainTextArea.setText("You can only dring 1 time");}
hpLabelNumber.setText(""+ playerHP);
choice1.setText("GO south");
choice2.setText("");

Loading…
Cancel
Save