Overview Scripts tileedit | leveledit | tganew | levelfancy Reference algo | ani | engine | fonts | high | html | layout | text | timer | vid Tutorials 1 | 2 | 3 | 4 | 5 GUI Ref. theme | style | widget | surface | const Containers container | app | table | document | area Forms form | group Widgets basic | button | input | keysym | slider | select | misc Other menus | dialog Tutorials 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
algo
Some handy algorithms for use in games, etc.
Please note that this file is alpha, and is subject to modification in
future versions of pgu!
astar
Uses the a* algorithm to find a path, and returns a list of positions
from start to end.
Arguments:
start -- start position
end -- end position
layer -- a grid where zero cells are open and non-zero cells are walls
dist -- a distance function dist(a,b) - manhattan distance is used
by default
getline
Returns a path of points from a to b
Arguments:
a -- starting point
b -- ending point
|