Browse Source

create player setup methode & add hit points value

master
Yazan Alaamer 2 years ago
parent
commit
d980ed3840
  1. 7
      src/main/java/game/StartDarkSoulsGame.java

7
src/main/java/game/StartDarkSoulsGame.java

@ -30,6 +30,7 @@ public class StartDarkSoulsGame {
JButton StartButton, choice1, choice2, choice3, choice4; JButton StartButton, choice1, choice2, choice3, choice4;
Container con; Container con;
TitelScreenHandler tsHandler= new TitelScreenHandler(); TitelScreenHandler tsHandler= new TitelScreenHandler();
int playerHP ; // comit (19) add player hp
public StartDarkSoulsGame() { public StartDarkSoulsGame() {
gui.Frame.setSize(800, 600); gui.Frame.setSize(800, 600);
@ -135,7 +136,13 @@ public class StartDarkSoulsGame {
playerPanel.add(weaponLabelName); playerPanel.add(weaponLabelName);
con.add(playerPanel); con.add(playerPanel);
PlayerSetup();
} }
public void PlayerSetup() {
playerHP = 15;
hpLabelNumber.setText(""+ playerHP);
}
public class TitelScreenHandler implements ActionListener{ public class TitelScreenHandler implements ActionListener{
public void actionPerformed(ActionEvent event) { public void actionPerformed(ActionEvent event) {
createGameScreen(); createGameScreen();

Loading…
Cancel
Save