Motivation

This commit is contained in:
Marco 2025-03-31 18:28:33 +02:00
commit e73596e464
13 changed files with 100 additions and 34 deletions

View file

@ -33,6 +33,8 @@ public partial class Hud : CanvasLayer
[Export] private Label _shieldLabel;
[Export] private ProgressBar _shieldBar;
[Export] private Label _motivationLabel;
[Export] private Container _itemsContainer;
@ -91,18 +93,6 @@ public partial class Hud : CanvasLayer
{
_gameOverPanel.Show();
_playerDead = true;
// ShowMessage("Game Over");
//
// var messageTimer = GetNode<Timer>("MessageTimer");
// await ToSignal(messageTimer, Timer.SignalName.Timeout);
//
// var message = GetNode<Label>("Message");
// message.Text = "Dodge the Creeps!";
// message.Show();
//
// await ToSignal(GetTree().CreateTimer(1.0), SceneTreeTimer.SignalName.Timeout);
// GetNode<Button>("StartButton").Show();
}
public void HideGameOver()
@ -135,6 +125,11 @@ public partial class Hud : CanvasLayer
_shieldBar.Value = newValue;
}
}
public void UpdateMotivation(float newValue, float maxValue)
{
_motivationLabel.Text = $"{newValue}%";
}
public void UpdateInteractable(Interactable interactable) {
GD.Print($"Interactable ${interactable.Name} entered in HUD");
@ -339,4 +334,6 @@ public partial class Hud : CanvasLayer
AddInventoryItem(item.Item, item.Count);
}
}