whoops, we should reset the grid to clear the closedSet, openSet, and scores

This commit is contained in:
2026-05-14 09:14:02 -05:00
parent 5b4887f0cc
commit 85855f00ff
+1
View File
@@ -262,6 +262,7 @@ func main() {
// Calculate Path Button // Calculate Path Button
if rg.Button(rl.NewRectangle(sidebarX+(10*scale), (screenHeight-(40*scale)), (180*scale), (30*scale)), "Calculate Path") { if rg.Button(rl.NewRectangle(sidebarX+(10*scale), (screenHeight-(40*scale)), (180*scale), (30*scale)), "Calculate Path") {
astar.ResetGrid()
path := astar.CalculatePath(int(startPos.X), int(startPos.Y), int(endPos.X), int(endPos.Y)) path := astar.CalculatePath(int(startPos.X), int(startPos.Y), int(endPos.X), int(endPos.Y))
fmt.Println(path) fmt.Println(path)
for _, p := range path { for _, p := range path {