Module: path_finding

Internal smart_move function Assume the path ahead is [i] [i+1] [i+2] - This routine checks whether [i+1] could be skipped The resulting path is smooth rather than rectangular and bumpy Try adding "function smooth_path(){}" or "smart.prune.smooth=false;" to your Code
Source:
Source:
Source:
Parameters:
Name Type Description
destination Object
Properties
Name Type Description
to string Can be of multiple values. If destination.to is a monster name we will find where they spawn and set the target destination. Monsters like the phoenix or mvampire have random spawn locations we want to check for the accordingly Every time we search for the phoenix we will try a different location so if nobody kill it we will eventually find it If destination to is one of "upgrade", "exchange", "potions", "scrolls" we will find the path to the closest shop that sells the items.
map string Destination map
x number Destination coordinates
y number Destination coordinates
on_done function Function that gets executed once the path finding finishes.
Source:
Source:
Source:
Source:
Source:
Source:
Parameters:
Name Type Description
destination Object
Properties
Name Type Description
to string Can be of multiple values. If destination.to is a monster name we will find where they spawn and set the target destination. Monsters like the phoenix or mvampire have random spawn locations we want to check for the accordingly Every time we search for the phoenix we will try a different location so if nobody kill it we will eventually find it If destination to is one of "upgrade", "exchange", "potions", "scrolls" we will find the path to the closest shop that sells the items.
map string Destination map
x number Destination coordinates
y number Destination coordinates
on_done function Function that gets executed once the path finding finishes.
Source:
Source:
Source:
Internal smart_move function
Source:
Source:
Source:
Parameters:
Name Type Description
destination Object
Properties
Name Type Description
to string Can be of multiple values. If destination.to is a monster name we will find where they spawn and set the target destination. Monsters like the phoenix or mvampire have random spawn locations we want to check for the accordingly Every time we search for the phoenix we will try a different location so if nobody kill it we will eventually find it If destination to is one of "upgrade", "exchange", "potions", "scrolls" we will find the path to the closest shop that sells the items.
map string Destination map
x number Destination coordinates
y number Destination coordinates
on_done function Function that gets executed once the path finding finishes.
Source:
Source:
Source:
Internal smart_move function
Source:
Source:
Source:
Parameters:
Name Type Description
destination Object
Properties
Name Type Description
to string Can be of multiple values. If destination.to is a monster name we will find where they spawn and set the target destination. Monsters like the phoenix or mvampire have random spawn locations we want to check for the accordingly Every time we search for the phoenix we will try a different location so if nobody kill it we will eventually find it If destination to is one of "upgrade", "exchange", "potions", "scrolls" we will find the path to the closest shop that sells the items.
map string Destination map
x number Destination coordinates
y number Destination coordinates
on_done function Function that gets executed once the path finding finishes.
Source:
Source:
Source:
Source:
Source:
Source:
Parameters:
Name Type Description
destination Object
Properties
Name Type Description
to string Can be of multiple values. If destination.to is a monster name we will find where they spawn and set the target destination. Monsters like the phoenix or mvampire have random spawn locations we want to check for the accordingly Every time we search for the phoenix we will try a different location so if nobody kill it we will eventually find it If destination to is one of "upgrade", "exchange", "potions", "scrolls" we will find the path to the closest shop that sells the items.
map string Destination map
x number Destination coordinates
y number Destination coordinates
on_done function Function that gets executed once the path finding finishes.
Source:
Source:
Source:
smart_move uses a Breadth-first search path finding algorithm to find the shortest path despite the name, smart_move isn't very smart or efficient, it's up to the players to implement a better movement method.
Source:
Source:
Source:
Parameters:
Name Type Description
destination Object
Properties
Name Type Description
to string Can be of multiple values. If destination.to is a monster name we will find where they spawn and set the target destination. Monsters like the phoenix or mvampire have random spawn locations we want to check for the accordingly Every time we search for the phoenix we will try a different location so if nobody kill it we will eventually find it If destination to is one of "upgrade", "exchange", "potions", "scrolls" we will find the path to the closest shop that sells the items.
map string Destination map
x number Destination coordinates
y number Destination coordinates
on_done function Function that gets executed once the path finding finishes.
Source:
Source:
Source:
Stop path finding and moving
Source:
Source:
Source:
Parameters:
Name Type Description
destination Object
Properties
Name Type Description
to string Can be of multiple values. If destination.to is a monster name we will find where they spawn and set the target destination. Monsters like the phoenix or mvampire have random spawn locations we want to check for the accordingly Every time we search for the phoenix we will try a different location so if nobody kill it we will eventually find it If destination to is one of "upgrade", "exchange", "potions", "scrolls" we will find the path to the closest shop that sells the items.
map string Destination map
x number Destination coordinates
y number Destination coordinates
on_done function Function that gets executed once the path finding finishes.
Source:
Source:
Source:
Internal smart_move function
Source:
Source:
Source:
Parameters:
Name Type Description
destination Object
Properties
Name Type Description
to string Can be of multiple values. If destination.to is a monster name we will find where they spawn and set the target destination. Monsters like the phoenix or mvampire have random spawn locations we want to check for the accordingly Every time we search for the phoenix we will try a different location so if nobody kill it we will eventually find it If destination to is one of "upgrade", "exchange", "potions", "scrolls" we will find the path to the closest shop that sells the items.
map string Destination map
x number Destination coordinates
y number Destination coordinates
on_done function Function that gets executed once the path finding finishes.
Source:
Source:
Source: