refactor: 调整怪物波次配置与优化同阵营间距计算

- 调整第一波怪物配置,将原近战Boss与近战小怪替换为近战Boss与远程小怪
- 增加怪物槽位及同阵营单位的横向间距,提升视觉清晰度
- 优化同阵营单位间距计算逻辑,为Boss单位提供更大的间隔空间
This commit is contained in:
panw
2026-04-08 10:38:40 +08:00
parent e7b0d55e36
commit 18d8d20056
3 changed files with 16 additions and 5 deletions

View File

@@ -52,7 +52,7 @@ export class MoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
private readonly heroFrontAnchorX = -50;
private readonly monFrontAnchorX = 50;
/** 常规同阵营横向最小间距 */
private readonly allySpacingX = 60;
private readonly allySpacingX = 65;
/** 纵向判定为同排的最大 Y 差 */
private readonly minSpacingY = 30;
/** 渲染层级重排节流,避免每帧排序 */
@@ -246,7 +246,18 @@ export class MoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
});
const slotIndex = Math.max(0, laneAllies.findIndex(entity => entity === self));
const frontAnchorX = model.fac === FacSet.MON ? this.monFrontAnchorX : this.heroFrontAnchorX;
const targetX = frontAnchorX - forwardDir * slotIndex * this.allySpacingX;
let totalSpacing = 0;
for (let i = 1; i <= slotIndex; i++) {
const prevAttrs = laneAllies[i - 1].get(HeroAttrsComp);
const currAttrs = laneAllies[i].get(HeroAttrsComp);
const isPrevBoss = prevAttrs?.is_boss;
const isCurrBoss = currAttrs?.is_boss;
const spacing = (isPrevBoss || isCurrBoss) ? 100 : this.allySpacingX;
totalSpacing += spacing;
}
const targetX = frontAnchorX - forwardDir * totalSpacing;
return Math.max(moveMinX, Math.min(moveMaxX, targetX));
}