Juan Arteaga
Member
This error is driving me crazy. Any help is greatly appreciated.
I got this room with three background layers.
"Background_floor" at depth 300 with a picture of a floor as background.
"Backgrounds_Lava_top" at depth 400 with a yellow color background.
"Backgrounds_Lava_bottom" at depth 500 with a red color background.
My idea was to increase and decrease the alpha of the Backgrounds_Lava_top layer to make it looks like there is some glowing lava/magma underneath the walkway where the player is walking.
So I have an object in the room that does this in every step:
The result?
For some reason the yellow layer gets on top of the floor!
I have been trying to figure this out with the debugger and the only thing I have seen is that when the game starts the "Background_floor" layer starts with an alpha of zero. But here is the thing as you can see in the GIF: The alpha can't be zero because the floor is visible and it is above the yellow layer.
I can't recall or find any other part of the code where I mess with the background layers, so I have no idea what might be happ
Anybody here has encountered a similar issue?
EDIT: I have tried changing the alpha of the Background_floor layer to 1 at the beginning of the room and it didn't solve the problem.
I got this room with three background layers.
"Background_floor" at depth 300 with a picture of a floor as background.
"Backgrounds_Lava_top" at depth 400 with a yellow color background.
"Backgrounds_Lava_bottom" at depth 500 with a red color background.
My idea was to increase and decrease the alpha of the Backgrounds_Lava_top layer to make it looks like there is some glowing lava/magma underneath the walkway where the player is walking.
So I have an object in the room that does this in every step:
GML:
var layer_id = layer_get_id("Backgrounds_Lava_top");
var layer_alpha = layer_background_get_alpha(layer_id);
layer_alpha += alpha_change_speed;
layer_background_alpha(layer_id,layer_alpha);
if(alpha_change_speed < 0 and layer_alpha <= 0){
alpha_change_speed = 0.01;
}else if(alpha_change_speed > 0 and layer_alpha >= 0.8){
alpha_change_speed = -0.01;
}
For some reason the yellow layer gets on top of the floor!
I have been trying to figure this out with the debugger and the only thing I have seen is that when the game starts the "Background_floor" layer starts with an alpha of zero. But here is the thing as you can see in the GIF: The alpha can't be zero because the floor is visible and it is above the yellow layer.
I can't recall or find any other part of the code where I mess with the background layers, so I have no idea what might be happ
Anybody here has encountered a similar issue?
EDIT: I have tried changing the alpha of the Background_floor layer to 1 at the beginning of the room and it didn't solve the problem.
Last edited by a moderator: