0

gml 中没有内置的睡眠功能,有没有办法在不使用警报的情况下执行睡眠功能?

4

2 回答 2

0

迟到的回复,但如果这是为了“冻结帧”(为了重音影响而短暂停顿),这可以通过繁忙的循环来完成:

/// busysleep(ms)
var t = current_time + argument0;
while (current_time < t) { }
于 2018-03-01T13:52:12.053 回答
0

创建变量 sleepStart 和 count,然后将它们设置为 0。在 step、begin step 或 end step 中,添加代码:

if (sleepStart==1){count+=1}
if (count==90){//That number can be whatever you want, depending on the length you want the delay.
//Code to be executed after specified number of steps here.
}

当你想开始延迟时,将 sleepStart 设置为 1。

如果您不知道,在默认的房间速度 30 下,90 步将是 3 秒。

于 2018-04-11T17:06:20.550 回答