2020-06-08 18:26:05 +08:00
|
|
|
class MainScene extends Scene {
|
|
|
|
|
constructor(displayContent: egret.DisplayObject){
|
|
|
|
|
super(displayContent);
|
|
|
|
|
|
|
|
|
|
this.addEntityProcessor(new SpawnerSystem(new Matcher()));
|
2020-06-09 19:45:09 +08:00
|
|
|
this.astarTest();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public astarTest(){
|
|
|
|
|
let graph = new AstarGridGraph(20, 20);
|
|
|
|
|
|
|
|
|
|
graph.weightedNodes.push(new Point(3, 3));
|
|
|
|
|
graph.weightedNodes.push(new Point(3, 4));
|
|
|
|
|
graph.weightedNodes.push(new Point(4, 3));
|
|
|
|
|
graph.weightedNodes.push(new Point(4, 4));
|
|
|
|
|
|
|
|
|
|
let path = graph.search(new Point(3, 4), new Point(15, 17));
|
|
|
|
|
console.log(path);
|
2020-06-08 18:26:05 +08:00
|
|
|
}
|
|
|
|
|
}
|