Good idea. By doing that, I found out that it's not selecting the lownode correctly. When path-finding from 5,5 to 10,10 it selects 4,6 as the first lownode, when it should be 6,6.
I tried making it loop through all the nodes until there were no changes made, but it's come to the same solution. Any ideas what I'm doing wrong here?
4,6 scores (G,H,F) as (14, 100, 114) where 6,6 is (14,80,94) yet it selects 4,6 as the lowest.
LowNode.F = 999999
Dim bChanged As Boolean = True 'tracks if there was a change or not
Do While bChanged = True 'cycle through until you make NO changes.
bChanged = False
For Each Node In OpenList
If Node.F < LowNode.F Then
Write(2, 2, Node.F, ConsoleColor.Cyan)
Write(2, 4, "vs", ConsoleColor.Yellow)
Write(2, 8, LowNode.F, ConsoleColor.Cyan)
LowNode = Node
bChanged = True
Console.ReadKey()
Console.Clear()
End If
Next
Loop
Console.Clear()
Write(2, 2, "Low Node", ConsoleColor.Yellow)
With LowNode
Write(4, 4, "X:", ConsoleColor.Yellow)
Write(5, 4, "Y:", ConsoleColor.Yellow)
Write(6, 4, "G:", ConsoleColor.Yellow)
Write(7, 4, "H:", ConsoleColor.Yellow)
Write(8, 4, "F:", ConsoleColor.Yellow)
Write(4, 7, .Self.X, ConsoleColor.Cyan)
Write(5, 7, .Self.Y, ConsoleColor.Cyan)
Write(6, 7, .G, ConsoleColor.Cyan)
Write(7, 7, .H, ConsoleColor.Cyan)
Write(8, 7, .F, ConsoleColor.Cyan)
Console.ReadKey()
Console.Clear()
End With