om() * this.engine.map[0].length);
    if (this.engine.graph.grid[rX][rY].weight == 1) {
      nextNode = {
        x: rX,
        y: rY
      }
    }
  }

  this.route = astar.search(this.engine.graph, this.engine.graph.grid[startX][startY], this.engine.graph.grid[nextNode.x][nextNode.y]);
  this.step = 0;
  this.speed = Math.random() / 100 + 0.01;
  if (this.route.length == 0) {
    this.getRoute(startX, startY)
  }
  this.setTarget(this.route[0].x, this.route[0].y);
}
            </code></pre>
          