Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

redblobgames pathfinding

current = goal 
path = []
while current != start: 
   path.append(current)
   current = came_from[current]
path.append(start) # optional
path.reverse() # optional
Source by www.redblobgames.com #
 
PREVIOUS NEXT
Tagged: #redblobgames #pathfinding
ADD COMMENT
Topic
Name
8+6 =