darijs1
Member
first i had made a simple room (map) from tiles.
then later i added a day night cycle, which contains something related to drawing a surface (copy pased from tutorial).
And finally i decided to add some blood and gore...aaand...see the picture for yourself.
As soon as i shoot my npc with a gun blood gets created, but along with it comes this sudden colorful change in the whole surface of the room.
im assuming it has something to do with more than one surfaces being drawn on start or something...
I have an obj_nightcycle with this in its draw event:
Code:
//if outside
if room = Room_1{
surface_set_target(nightcyclesurf);
draw_clear(c_black);
//draw glow
with(obj_lamppost){
draw_set_blend_mode(bm_src_color);
draw_sprite_ext(spr_light,0,x,y,glowsize,glowsize,0,c_white,1);
draw_set_blend_mode(bm_normal)
}
surface_reset_target();
draw_surface_ext(nightcyclesurf,0,0,1,1,0,c_white,alpha);
}
Code:
//set variables
alpha = -3;
daylength = 20;
nightlength = 20;
alarm[0] = room_speed*daylength;
//set surface
nightcyclesurf = surface_create(room_width, room_height);
Code:
//blood system
partblood_sys = part_system_create();
//blood particle
partblood = part_type_create();
part_type_shape(partblood,pt_shape_square);
part_type_size(partblood,0.1,0.05,-0.01,0);
part_type_color1(partblood,255);
part_type_alpha1(partblood,1);
part_type_speed(partblood,1,3,0,0);
part_type_direction(partblood,0,359,0,0);
part_type_gravity(partblood,0.3,270);
part_type_blend(partblood,0);
part_type_life(partblood,30,700);
//create emitter
partblood_emit = part_emitter_create(partblood_sys);
//create surface
surfblood = surface_create(room_width, room_height);
//surface fix
w = window_get_width();
h = window_get_height();
Code:
if !surface_exists(surfblood){
surfblood = surface_create(room_width,room_height);
}else {
draw_surface(surfblood,0,0);
}