fix(g20): уменьшил зазоры метки и health-bar

LabelManager использует opts.height как ГАП от верха AABB до плашки,
а не абсолютную высоту. Передавал 3 — метка летела далеко вверх.
Стало 0.3 — небольшой зазор над головой.

Health-bar опустил с y+2.4 до y+1.9 — ближе к голове.
This commit is contained in:
min 2026-06-09 21:17:16 +03:00
parent 7595668b03
commit 4320c6adeb
2 changed files with 3 additions and 3 deletions

View File

@ -1743,7 +1743,7 @@ local won = false
-- Спавним всех врагов и метки над ними -- Спавним всех врагов и метки над ними
for i, e in ipairs(enemies) do for i, e in ipairs(enemies) do
e.ref = __rbxl_spawn_npc("character-b", e.x, 1, e.z, e.name, e.hp, 0) e.ref = __rbxl_spawn_npc("character-b", e.x, 1, e.z, e.name, e.hp, 0)
__rbxl_set_label(e.ref, e.name .. " HP: " .. e.hp, "#ff5555", 4) __rbxl_set_label(e.ref, e.name .. " HP: " .. e.hp, "#ff5555", 0.3)
-- Callback на смерть NPC -- Callback на смерть NPC
__rbxl_npc_on_death(e.ref, function() __rbxl_npc_on_death(e.ref, function()
if e._dead then return end if e._dead then return end
@ -1773,7 +1773,7 @@ for _, e in ipairs(enemies) do
enemy.hp = enemy.hp - 30 enemy.hp = enemy.hp - 30
if enemy.hp < 0 then enemy.hp = 0 end if enemy.hp < 0 then enemy.hp = 0 end
__rbxl_npc_damage(enemy.ref, 30) __rbxl_npc_damage(enemy.ref, 30)
__rbxl_set_label(enemy.ref, enemy.name .. " HP: " .. enemy.hp, "#ff5555", 4) __rbxl_set_label(enemy.ref, enemy.name .. " HP: " .. enemy.hp, "#ff5555", 0.3)
__rbxl_spawn_particles("sparks", enemy.x, 2, enemy.z, 0.4, 1) __rbxl_spawn_particles("sparks", enemy.x, 2, enemy.z, 0.4, 1)
hitSound:Play() hitSound:Play()
end) end)

View File

@ -470,7 +470,7 @@ export class NpcManager {
const show = npc.hp < npc.maxHp; const show = npc.hp < npc.maxHp;
hb.anchor.setEnabled(show); hb.anchor.setEnabled(show);
if (show) { if (show) {
hb.anchor.position.set(npc.x, npc.y + 2.4, npc.z); hb.anchor.position.set(npc.x, npc.y + 1.9, npc.z);
const pct = Math.max(0, Math.min(1, npc.hp / npc.maxHp)); const pct = Math.max(0, Math.min(1, npc.hp / npc.maxHp));
hb.fill.scaling.x = pct; hb.fill.scaling.x = pct;
hb.fill.position.x = -(1 - pct) * hb.barWidth / 2; hb.fill.position.x = -(1 - pct) * hb.barWidth / 2;