mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-04-19 17:16:08 +08:00
fix: 移动的平滑视角
This commit is contained in:
parent
f03eae4345
commit
5685efd4d5
@ -117,7 +117,6 @@ export class FloorViewport implements ILayerGroupRenderExtends {
|
|||||||
this.group.removeTicker(this.transition, false);
|
this.group.removeTicker(this.transition, false);
|
||||||
this.nx = nx;
|
this.nx = nx;
|
||||||
this.ny = ny;
|
this.ny = ny;
|
||||||
console.log(nx, ny);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -486,10 +486,13 @@ export class HeroMover extends ObjectMoverBase {
|
|||||||
await adapter.all('readyMove');
|
await adapter.all('readyMove');
|
||||||
// 这里要检查前面那一格能不能走,不能走则不触发平滑视角,以避免撞墙上视角卡住
|
// 这里要检查前面那一格能不能走,不能走则不触发平滑视角,以避免撞墙上视角卡住
|
||||||
const { x, y } = core.status.hero.loc;
|
const { x, y } = core.status.hero.loc;
|
||||||
const data = this.checkCanMove(x, y, toDir(this.faceDir));
|
const firstDir = controller.queue.find(v => v.type === 'dir')?.value;
|
||||||
|
if (firstDir) {
|
||||||
|
const data = this.checkCanMove(x, y, toDir(firstDir as Dir));
|
||||||
if (data.canMove && !data.noPass) {
|
if (data.canMove && !data.noPass) {
|
||||||
viewport.sync('startMove');
|
viewport.sync('startMove');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
adapter.sync('startAnimate');
|
adapter.sync('startAnimate');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user