Analysis update

This commit is contained in:
2026-05-13 22:27:45 +01:00
parent 820d6c1715
commit 1a1d399327
3 changed files with 153 additions and 20 deletions
+2 -4
View File
@@ -108,10 +108,8 @@ query = tag(:enemy) & component(:health, true) & anti(name("Trap Preview", true)
world.system :health_regen, for: query do |match, dt| # no trigger means always
# example of a simple health regeneration system that regenerates health for all entities with a health component
healths = match[0]
healths.each do |health|
health.health += 1 * dt # regenerate 1 health per second, dt is the delta time since the last update frame, so this will regenerate 1 health per second regardless of the frame rate
health.health = [health.health, 100].min # cap health at 100
end
healths.add_scalar! :health, 1 * dt
healths.clamp! :health, 0, 100
end
trigger = [:place]