当我尝试在某些步骤后改变游戏速度时,我所拥有的随机背景生成器不再起作用了。如果我的游戏速度不是宽度分辨率数的因素,我过去遇到过这个问题。我尝试了4,5和8但我仍然遇到了问题。
示例:https://gyazo.com/6e544a88f5b2b556d3a985944c38faff
//Game speed
global.spd = -5;
// Viteza background
background_index[0] = bck_1;
background_hspeed[0] = global.spd ;
// Backgrounds
background_index[0] = bck_1;
background_hspeed[0] = global.spd ;
background_index[1] = choose(bck_2,bck_1)
background_hspeed[1] = global.spd ;
background_x[1] = 960
background_y[1] = 0
//Change Backgrounds
if (background_x[1] == 0)
{ background_index[0] = choose(bck_2,bck_1,bck_3,bck_4)
background_x[0] = 960
}
else
if (background_x[0] == 0)
{ background_index[1] = choose(bck_2,bck_1,bck_3,bck_4)
background_x[1] = 960
}
编辑:知道了!
https://www.reddit.com/r/gamemaker/comments/4z7nkh/changing_game_speed_is_destroying_my_backgrounds/