Skip to content

Commit

Permalink
Update astarpathfind.js
Browse files Browse the repository at this point in the history
Cleaner Code
  • Loading branch information
YogaindoCR authored Dec 31, 2024
1 parent 308a3d5 commit 6987172
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions extensions/YogaindoCR/astarpathfind.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ const menuIconURI =
class AStarExtension {
getInfo() {
return {
id: 'astarpathfind',
name: 'A* Pathfinder',
color1: "#43d3dd",
color2: "#2b5a68",
menuIconURI,
id: 'astarpathfind',
name: 'A* Pathfinder',
color1: "#43d3dd",
color2: "#2b5a68",
menuIconURI,
blocks: [
{
opcode: 'findPath',
Expand Down Expand Up @@ -124,7 +124,7 @@ class AStarExtension {
const current = openSet.shift();

if (current.node.x === end2D.x && current.node.y === end2D.y) {
return current.path.map(coord => this.coordsToIndex(coord, gridSize)).concat(end).join(" ");
return current.path.map(coord => this.coordsToIndex(coord, gridSize)).concat(end).join(" ");
}

closedSet.add(this.coordsToIndex(current.node, gridSize));
Expand Down

0 comments on commit 6987172

Please sign in to comment.