我不明白你的目标,所以举几个例子:
示例 1.
创建事件:
background_index[0] = background0;
background_index[1] = background1;
步骤事件:
seconds = current_second;
if seconds < 30
{
background_visible[0] = true;
background_visible[1] = false;
}
else
{
background_visible[0] = false;
background_visible[1] = true;
}
示例 2. 相同,但使用警报
创建事件:
background_index[0] = background0;
background_index[1] = background1;
event_perform(ev_alarm, 0);
警报 0 事件:
seconds = current_second;
if seconds < 30
{
background_visible[0] = true;
background_visible[1] = false;
}
else
{
background_visible[0] = false;
background_visible[1] = true;
}
alarm[0] = room_speed * 30;
示例 3。 其他想法...
创建事件:
background_index[0] = background0;
background_index[1] = background1;
background_visible[0] = true;
background_visible[1] = true;
event_perform(ev_alarm, 0);
警报 0 事件:
seconds = current_second;
if seconds < 30
{
background_index[0] = background0;
background_index[1] = background1;
}
else
{
background_index[0] = background1;
background_index[1] = background0;
}
background_x[0] = 0;
background_x[1] = 0;
background_hspeed[0] = 0;
background_hspeed[1] = -2;
alarm[0] = room_speed * 30;
如果您需要多次更改背景,则需要使用step 事件或警报,因为create 事件只执行一次。另外,当您使用滚动时,您需要记住,一段时间后x 的背景位置将在屏幕之外,因此您看不到背景(背景平铺时除外)。