81 lines
3.0 KiB
HTML
81 lines
3.0 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
|
|
<html>
|
|
<head>
|
|
<title>Paths</title>
|
|
<link href="style.css" rel="stylesheet" type="text/css">
|
|
</head>
|
|
<body background="images/back.gif">
|
|
<!--START-->
|
|
|
|
<h3>Paths</h3>
|
|
|
|
In <I>Game Maker</I> you can define paths and order instances to follow such paths.
|
|
Although you can use actions for this, there are functions and variables that give
|
|
you more flexibility:
|
|
|
|
<p>
|
|
<blockquote>
|
|
<tt><b>path_start(path,speed,endaction,absolute)</b></tt>
|
|
Starts a path for the current instance. The <TT>path</TT> is the name of the path you
|
|
want to start. The <TT>speed</TT> is the speed with which the path must be followed.
|
|
A negative speed means that the instance moves backwards along the path. The
|
|
<TT>endaction</TT> indicates what should happen when the end of the path
|
|
is reached. The following values can be used:
|
|
<p>
|
|
<blockquote>
|
|
0 : stop the path<br>
|
|
1: continue from the start position (if the path is not closed we jump to the start position<br>
|
|
2: continue from the current position<br>
|
|
3: reverse the path, that is change the sign of the speed<br>
|
|
</blockquote>
|
|
The argument <TT>absolute</TT> should be true or false. When true the absolute
|
|
coordinates of the path are used. When false the path is relative to the current
|
|
position of the instance. To be more precise, if the speed is positive, the start
|
|
point of the path will be placed on the current position and the path is followed
|
|
from there. When the speed is negative the end point of the path will be placed
|
|
on the current position and the path is followed backwards from there.<br>
|
|
<tt><b>path_end()</b></tt>
|
|
Ends the following of a path for the current instance.<br>
|
|
<tt><b>path_index*</b></tt>
|
|
Index of the current path the instance follows. You cannot change this
|
|
directly but must use the function above.<br>
|
|
<tt><b>path_position</b></tt>
|
|
Position in the current path. 0 is the beginning of the path. 1 is the end of
|
|
the path. The value must lie between 0 and 1.<br>
|
|
<tt><b>path_positionprevious</b></tt>
|
|
Previous position in the current path. This can be used e.g. in collision events
|
|
to set the position on the path back to the previous position.<br>
|
|
<tt><b>path_speed</b></tt>
|
|
Speed (in pixels per step) with which the path must be followed. Use a
|
|
negative speed to move backwards.<br>
|
|
<tt><b>path_orientation</b></tt>
|
|
Orientation (counter-clockwise) into which the path is performed. 0 is
|
|
the normal orientation of the path.<br>
|
|
<tt><b>path_scale</b></tt>
|
|
Scale of the path. Increase to make the path larger. 1 is the default value.<br>
|
|
<tt><b>path_endaction</b></tt>
|
|
The action that must be performed at the end of the path. You
|
|
can use the values indicated above.<br>
|
|
</blockquote>
|
|
|
|
|
|
|
|
<!--END-->
|
|
</body>
|
|
</html>
|
|
|
|
<!-- KEYWORDS
|
|
path functions
|
|
|
|
path_start()
|
|
path_end()
|
|
path_index
|
|
path_position
|
|
path_positionprevious
|
|
path_speed
|
|
path_scale
|
|
path_orientation
|
|
path_endaction
|
|
|
|
--> |