fix: 移除怪物移动位置限制并扩大移动边界
移除怪物移动目标位置的水平坐标限制,使其可以移动到任意X坐标。 同时将英雄和怪物的移动边界值扩大到极大值,以消除移动范围限制。
This commit is contained in:
@@ -189,7 +189,7 @@ export class Monster extends ecs.Entity {
|
|||||||
const move = this.get(MoveComp);
|
const move = this.get(MoveComp);
|
||||||
move.reset();
|
move.reset();
|
||||||
move.direction = -1;
|
move.direction = -1;
|
||||||
move.targetX = Math.max(-320, Math.min(320, pos.x));
|
move.targetX = pos.x;
|
||||||
move.baseY = dropToY;
|
move.baseY = dropToY;
|
||||||
move.moving = false;
|
move.moving = false;
|
||||||
|
|
||||||
|
|||||||
@@ -67,16 +67,16 @@ export class MoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
|||||||
*/
|
*/
|
||||||
private readonly facConfigs: Record<number, MoveFacConfig> = {
|
private readonly facConfigs: Record<number, MoveFacConfig> = {
|
||||||
[FacSet.HERO]: {
|
[FacSet.HERO]: {
|
||||||
moveFrontX: 320,
|
moveFrontX: 999999,
|
||||||
moveBackX: -320,
|
moveBackX: -999999,
|
||||||
retreatFrontX: 300,
|
retreatFrontX: 999999,
|
||||||
retreatBackX: -300,
|
retreatBackX: -999999,
|
||||||
},
|
},
|
||||||
[FacSet.MON]: {
|
[FacSet.MON]: {
|
||||||
moveFrontX: -320,
|
moveFrontX: -999999,
|
||||||
moveBackX: 320,
|
moveBackX: 999999,
|
||||||
retreatFrontX: -300,
|
retreatFrontX: -999999,
|
||||||
retreatBackX: 300,
|
retreatBackX: 999999,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user