跳到主要内容

FAStarBase.get_diag_move

声明

public bool get_diag_move()

参数

参数名描述

作用

该接口用来获取地图通行模式 true:8方向 false:4方向

使用方式

map.gs

component pkg.astar.components.FAStarBase;

void create(array para)
{
this.init_map(para);
}

test.gs

array grids = 
[
[0, 0, 0, 0, 1, 1, 0, 1, 0, 1],
[1, 0, 0, 0, 1, 1, 0, 1, 0, 1],
[1, 1, 0, 0, 1, 1, 0, 1, 0, 1],
[1, 1, 1, 0, 1, 1, 0, 1, 0, 1],
[0, 1, 0, 0, 1, 1, 0, 1, 0, 1],
[1, 0, 1, 0, 0, 0, 0, 1, 0, 1],
[0, 0, 0, 0, 1, 1, 0, 0, 0, 1],
[0, 0, 0, 0, 1, 1, 1, 1, 0, 1],
[0, 0, 0, 0, 1, 1, 0, 1, 0, 1],
[0, 0, 0, 0, 1, 1, 1, 0, 1, 1],
];

object m = new_object(map, this_domain(), grids);

write(m.get_diag_move());

返回文档