跳到主要内容

move 移动角色

move

类型: MethodDeclaration

所属类: Actor

定义位置: actor.ts

描述

移动角色

参数 x: 位移X

参数 y: 位移Y

参数

参数名类型描述默认值
xnumber--
ynumber--

返回值

类型: void

源代码

位置: 第 1049 行

public move(x: number, y: number): void {
this.x += x;
this.y += y;
// 设置碰撞器为已经移动状态
this.collider.moved = true;
this.collider.handleImmovableCollisions();
}

文档生成时间:2026/2/1 16:51:38