mirror of
https://github.com/motajs/template.git
synced 2026-11-25 07:24:30 +08:00
feat: 完善内置特殊属性
This commit is contained in:
1 parent
a0e402728e
commit
3f74d5f25e
10 files changed
+221
-16
No files matched your search
@@ -450,6 +450,21 @@ export class MapLayer
|
||||
this.forEachHook(hook => hook.onUpdateDynamicPosition?.(tile));
|
||||
}
|
||||
|
||||
async moveBlock(
|
||||
x: number,
|
||||
y: number,
|
||||
direction: FaceDirection,
|
||||
count: number = 1,
|
||||
time: number = 500,
|
||||
keepEvent: boolean = true
|
||||
): Promise<void> {
|
||||
const dynamic = this.transferToDynamic(x, y, keepEvent);
|
||||
if (!dynamic) return;
|
||||
dynamic.mover.speed(time).step(direction, count);
|
||||
await dynamic.mover.start()?.onEnd;
|
||||
this.transferToStatic(dynamic, keepEvent);
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region 开关门
|
||||
|
||||
Reference in new issue
Block a user