feat: refactoring && walls

This commit is contained in:
2024-04-18 16:04:53 +07:00
parent 6333d80fd4
commit 36af656e0d
20 changed files with 202 additions and 93 deletions

View File

@@ -0,0 +1,29 @@
using BakeryGame.Components.Player;
using Raylib_cs;
using Scellecs.Morpeh;
namespace BakeryGame.Systems.Rendering;
public class HPRenderSystem : ILateSystem
{
private Filter _filter;
public World World { get; set; }
public void Dispose()
{
}
public void OnAwake()
{
_filter = World.Filter.With<HealthComponent>().Build();
}
public void OnUpdate(float deltaTime)
{
foreach (var entity in _filter)
{
var healthComponent = entity.GetComponent<HealthComponent>();
Raylib.DrawText($"HP: {healthComponent.HealthPoints}", 12, 12, 20, Color.Black);
}
}
}