path_endaction

当实例到达当前路径的末尾时,此变量可用于获取或更改实例的反应。通常,当您使用path_start()启动路径时会设置此值,但您可能希望根据游戏中的任何事件数来更改此行为。可用值用以下常数表示:

路径结束动作常量
常量描述
path_action_stopStop the path
path_action_restartContinue from start position, jumping to the start if the path is not closed
path_action_continueStart the path again from the current position
path_action_reverseReverse the speed of the path (run the path in reverse)

 

语法:

path_endaction;

 

返回:

路径结束动作常量

 

例子:

if (path_endaction == path_action_stop)
{
    path_endaction = path_action_reverse;
}

上面的代码将检查路径结束操作,如果设置为停止,则结束操作将更改为反向。