A Path is a series of points that can be followed by some objects. This way controlled movement can be implemented, like opening doors, moving platforms, traps, etc.
(path
(mode "circular")
(node
(x 800)
(y 96)
(time 0.3)
)
(node
(x 832)
(y 96)
(time 1.0)
)
)
A path consists of a mode setting and one or more nodes.
The mode specifies the behavior at the end of the path when automatic movement is activated, i.e. the object is going to all nodes in order one by one (rather than being told to go to a specific node and stay there). It takes one string argument with the following possible values:
Example:
(mode "circular")
Nodes are points in the level along which the associated object moves. They have the following attributes:
Example:
(node
(x 42)
(y 23)
(time 1.337)
)
Objects a path is associated with usually provide the following methods:
Method | Explanation |
---|---|
goto_node(int node_no) |
Advances until at given node, then stops. The index of the first node is 0. |
start_moving() |
Starts advancing automatically. |
stop_moving() |
Stops advancing automatically. |