此函数为运行代码的实例设置新的移动方向和新的速度。请注意,此不会将添加到实例的当前速度和方向(因为您将使用motion_add()),而是将其强制添加到新设置。
motion_set(dir, speed);
N/A
if (irandom(9) = 1){ motion_set(random(360), 1 + random(3));}
上述代码将使实例以随机间隔更改速度和方向。