better healthbars and one for the player as well
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 42s
Create tag and build when new code gets to main / Test (push) Successful in 6m13s
Create tag and build when new code gets to main / Export (push) Successful in 7m5s

This commit is contained in:
2026-01-26 18:09:29 +01:00
parent 2fdc9c7ca8
commit ddf1bd019b
12 changed files with 190 additions and 49 deletions

View File

@@ -1,10 +1,12 @@
using Godot;
using System;
using Movementtests.interfaces;
public partial class PlayerUi : Control
{
private TextureRect[] _dashIcons = new TextureRect[3];
private TextureRect _enemyTarget;
private Healthbar _healthbar;
public enum TargetState
{
@@ -30,6 +32,12 @@ public partial class PlayerUi : Control
_dashIcons[2] = GetNode<TextureRect>("%Dash3");
_enemyTarget = GetNode<TextureRect>("%EnemyTarget");
_healthbar = GetNode<Healthbar>("%Healthbar");
}
public void Initialize(float initialHealth)
{
_healthbar.Initialize(initialHealth);
}
public void SetEnemyTargetProperties(TargetProperties targetProperties)
@@ -59,5 +67,10 @@ public partial class PlayerUi : Control
dashIcon.SetVisible(index <= numberOfDashes);
index++;
}
}
}
public void OnHealthChanged(IHealthable healthable, HealthChangedRecord healthChanged)
{
_healthbar.CurrentHealth = healthChanged.CurrentHealth;
}
}