NicoDT
Member
Hello everyone!
I'm trying to figure out a problem I have, but had not luck yet.
I'm appliying a night surface with the size of the screen. The thing is I want certain skills (like fire) not to become dark.
So far, it works. The problem is that with the way the code works, it doesn't take into consideration depth, and as you can see in the second picture, the skill's "light" is visible even behind the tree (and other tiles)
Any help with how I should approach this is really appreciated!
I'm trying to figure out a problem I have, but had not luck yet.
During day (the skill looks horrible the way it is right now, pay no attention! haha)
At night
At night
I'm appliying a night surface with the size of the screen. The thing is I want certain skills (like fire) not to become dark.
So far, it works. The problem is that with the way the code works, it doesn't take into consideration depth, and as you can see in the second picture, the skill's "light" is visible even behind the tree (and other tiles)
Code:
if !surface_exists(night_surface)
{
night_surface = surface_create(room_width, room_height)
}
else
{
surface_set_target(night_surface)
draw_clear(c_black)
with (obj_animation_aux) {
if (light = true) {
if (sprite_index != -1) {
draw_set_blend_mode(bm_src_color);
draw_sprite_ext(sprite_index,image_index,x-view_xview,y-view_yview,image_xscale,image_yscale,image_angle,image_blend,0.85)
draw_set_blend_mode(bm_normal)
}
}
}
surface_reset_target();
draw_surface_ext(night_surface,view_xview,view_yview,1,1,0,c_white, night_alpha)
}
Any help with how I should approach this is really appreciated!