### Designing Games with GameMaker

### Paths

It is possible to create paths and to add points to paths. However, never change a path that is being used by an instance. This can lead to unexpected results. The following functions exist:

Sets the kind of connections of the path with the given index (0=straight, 1=smooth).path_set_kind(ind,val)

Sets whether the path must be closed (true) or open (false).path_set_closed(ind,closed)

Sets the precision with which the smooth path is calculated (should lie between 1 and 8).path_set_precision(ind,prec)

Adds a new empty paths. The index of the path is returned.path_add()

Deletes the path with the given index.path_delete(ind)

Creates a duplicate copy of the path with the given index. Returns the index of the copy.path_duplicate(ind)

Assigns the indicated path to path ind. So this makes a copy of the path. In this way you can easily set an existing path to a different, e.g. new path.path_assign(ind,path)

Appends the indicated path to path ind.path_append(ind,path)

Adds a point to the path with the given index, at position (x,y) and with the given speed factor. Remember that a factor of 100 corresponds to the actual speed. Lower values mean slowing down and higher mean speeding up.path_add_point(ind,x,y,speed)

Inserts a point in the path with the given index before point n, at position (x,y) and with the given speed factor.path_insert_point(ind,n,x,y,speed)

Changes the point n in the path with the given index to position (x,y) and the given speed factor.path_change_point(ind,n,x,y,speed)

Deletes the point n in the path with the given index.path_delete_point(ind,n)

Clears all the points in the path, turning it into an empty path.path_clear_points(ind)

Reverses the path.path_reverse(ind)

Mirrors the path horizontally (with respect to its center).path_mirror(ind)

Flips the path vertically (with respect to its center).path_flip(ind)

Rotates the path counter clockwise over angle degrees (around its center).path_rotate(ind,angle)

Scales the path with the given factors (from its center).path_scale(ind,xscale,yscale)

Shifts the path over the given amount.path_shift(ind,xshift,yshift)

### Alternative versions

You can also read this manual on one single long page (± 1.5 mb)

Also available in:

Download helpfile

Also available in:

Download helpfile