将下列javascript代码改写成typescirpt: const STATE = cc.Enum({ IDLE:1, ATTACK:2, MOVE:3, DODGE:4 }) module.exports = { State:STATE, checkCollide(o,n,long=0){ return !(!n || o.x - n.cW.x-long > n.x + n.cW.x || o.x + o.cW.x + long < n.x - n.cW.x || o.y > n.y + n.cW.y || o.y + o.cW.y < n.y); }, boundary:1620, }
时间: 2024-04-28 21:22:14 浏览: 89
0.0-rc-5/include --proto_path=/usr/protobuf-3.0.0-rc-5/include --proto_pathconst STATE = cc.Enum({
IDLE = 1,
ATTACK = 2,
MOVE = 3,
DODGE=/usr/local/protobuf-3.0.0-rc-6/include --proto_path=/usr/protobuf-3.0.0 = 4
});
export const State = STATE;
export function checkCollide(o: any, n: any, long = 0):-rc-6/include --proto_path=/usr/local/protobuf-3.0.0-rc-7/include --proto_path=/usr boolean {
return !(!n || o.x - n.cW.x - long > n.x + n.cW.x || o.x +/protobuf-3.0.0-rc-7/include --proto_path=/usr/local/protobuf-3.0.0-rc o.cW.x + long < n.x - n.cW.x || o.y > n.y + n.cW.y || o.y +-8/include --proto_path=/usr/protobuf-3.0.0-rc-8/include --proto_path=/usr/local/protobuf o.cW.y < n.y);
}
export const boundary = 1620;
阅读全文