Path getxy

From Bennu Wiki
Jump to navigation Jump to search


Syntax

INT path_getxy ( <POINTER x>, <POINTER y> )

Description

This function gets a node and returns a 1 when there's still a point left, or a 0 when there are no more points. This function requires a two dimensional Array to work on. The arguments should accessed with the Offset operator. The function is typically used inside a loop. The pathfinding in bennu is based on the A* algorithm. It uses a logic map with a maze, a start position and an end position.

Here's the bennu source code: mod_path.c, wikipedia page about pathfinding.


Parameters

POINTER x - Offset of the array with the x values.
POINTER y - Offset of the array with the y values.

Returns

INT : Status.

0 - There are no more coordinate points (nodes) in the list.
1 - There are still coordinate points (nodes) in the list.

Example

Look at this tutorial: Tutorial:Pathfind_demo.


Mod_path
Constants
Functions Pathfind()Pathgetxy()Pathwall()