From f9fac2c9f69cec4bceb162ef71654c26aecc7314 Mon Sep 17 00:00:00 2001 From: magnsskj <magnsskj@stud.ntnu.no> Date: Sat, 1 Apr 2023 13:43:22 +0200 Subject: [PATCH] (#18): setter to change visible health --- .../core/src/com/game/tankwars/view/GameHud.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/frontend/core/src/com/game/tankwars/view/GameHud.java b/frontend/core/src/com/game/tankwars/view/GameHud.java index 36d6338..2420b1a 100644 --- a/frontend/core/src/com/game/tankwars/view/GameHud.java +++ b/frontend/core/src/com/game/tankwars/view/GameHud.java @@ -116,4 +116,20 @@ public class GameHud { public Button getMoveRight() { return moveRight; } + + /** + * Set visible health of player + * @param health new health of player + */ + public void setPlayerHealth(int health) { + healthProgressBarPlayer.setValue(health); + } + + /** + * Set visible health of opponent + * @param health new health of opponent + */ + public void setOpponentHealth(int health) { + healthProgressBarOpponent.setValue(health); + } } -- GitLab