From 731936d12e83f58ba09ab266a4dd807202e157f5 Mon Sep 17 00:00:00 2001 From: Yazan Alaamer Date: Wed, 25 Jan 2023 11:22:09 +0100 Subject: [PATCH] refactoring: fix player can not die when attacking the guard --- src/main/java/game/StartDarkSoulsGame.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/game/StartDarkSoulsGame.java b/src/main/java/game/StartDarkSoulsGame.java index 5981731..11d1112 100644 --- a/src/main/java/game/StartDarkSoulsGame.java +++ b/src/main/java/game/StartDarkSoulsGame.java @@ -177,6 +177,9 @@ public class StartDarkSoulsGame { + "Guard fought back with sowrd of ashina " + "\n(you recieve 3 damage) "); playerHP = playerHP -3; + if (playerHP == 0) { + lose(); + } hpLabelNumber.setText(""+ playerHP); choice1.setText(">"); choice2.setText("");