Skip to content
Advertisement

Tag: path-finding

2D grid is not fitting in JFrame for pathing visualizer

I am trying to create a 2D grid with node sizes depending on the size of the height/width of the frame but whenever I run the program, the bottom row and right columns are somewhat cut off. Here is my execution code: Here is the Grid class: And here is the GridFrame class: I have also been messing around with

A* pathfinding algorithm is being semi-greedy

So I have been trying to implement the A* pathfinding algorithm for a 2D tilemap in Java from this video: https://www.youtube.com/watch?v=-L-WgKMFuhE. I tried following the pseudocode and not enough details, I felt, were not explained greatly, especially the idea of the G cost. So, I decided to go into the actual code the video creator wrote and used a lot

Advertisement