Never expirenced lag with it, and it's kinda easy-ish
light_surf_none=surface_create(room_width,room_height);
surface_set_target(light_surf_none);
surface_reset_target();
draw_clear_alpha(c_black,1);
temp_light_mod = 0
alarm[0] = 10
if(!instance_exists(PlayerObj)){
instance_destroy()
}
if surface_exists(light_surf_none){
surface_set_target(light_surf_none);
draw_set_blend_mode(bm_subtract);
draw_clear_alpha(c_black,(global.lightingLevel-temp_light_mod)/100);
with (PlayerObj){
if(flashlight) draw_sprite_ext(LightConeS,0,x,y,1,1,aimDir,c_white,1)
if(tempType = BALLISTIC_TYPE && gun_image > 0){
//draw_sprite_ext(LightCircleS,0,x+lengthdir_x(35,aimDir),y+lengthdir_y(35,aimDir)-4,2.57,2,aimDir,c_white,1)
if(other.temp_light_mod < 50){
other.temp_light_mod = 50
other.alarm[0] = 2
}
}
}
with (FlameO){
draw_sprite_ext(LightCircleS,0,x,y,image_xscale/2.5+((random(10)/100)-.05),image_yscale/2.5+((random(10)/100)-.05),0,c_white,1)
}
with (FalseFireO){
draw_sprite_ext(LightCircleS,0,x,y,image_xscale/2.5+((random(10)/100)-.05),image_yscale/2.5+((random(10)/100)-.05),0,c_white,1)
}
with (ElectricField){
draw_sprite_ext(LightCircleS,0,x,y,1.5+((random(100)/100)-.5),1.5+((random(100)/100)-.5),random(360),c_white,1)
if(other.temp_light_mod < random(25)+25){
other.temp_light_mod = random(25)+25
other.alarm[0] = 2
}
}
with (Gib){
if(lighted) draw_sprite_ext(LightCircleS,0,x,y,.5,.5,0,c_white,1)
}
with (LightObj){
draw_sprite_ext(type,0,x,y,x_size,y_size,rot,c_white,1)
}
with (Storefront){
if(goto_room != -1){
draw_sprite_ext(LightCircleS,0,x-43,y+14,.75,.75,0,c_white,1)
draw_sprite_ext(LightCircleS,0,x+43,y+14,.75,.75,0,c_white,1)
draw_sprite_ext(LightCircleS,0,x,y+20,1,1,0,c_white,1)
}
}
with (HolidayStorefront){
if(goto_room != -1){
draw_sprite_ext(LightCircleS,0,x-43,y+14,.75,.75,0,c_white,1)
draw_sprite_ext(LightCircleS,0,x+43,y+14,.75,.75,0,c_white,1)
draw_sprite_ext(LightCircleS,0,x,y+20,1,1,0,c_white,1)
}
}
draw_set_blend_mode(bm_normal);
surface_reset_target();
}
if (surface_exists(light_surf_none)){
draw_surface_ext(light_surf_none,0,0,1,1,0,c_white,1)
}
The alarm[0] is just to make the temporary light set back to 0