This part adds weighting to every block in the map, using an algorithm described by Boltest here: https://scratch.mit.edu/projects/374026476.
Following this video Series by FUNUT: https://www.youtube.com/watch?v=L6DCC7IUSaw The pathfinding algorithm used is described by Boltest here: https://scratch.mit.edu/projects/374026476