T2008
Member
When the player dies, it creates a room transition which draws a red fade over the screen and then goes to title screen with a black fade. The second part works right, but it won't draw the first red part. I have no idea why? Any insights would be greatly appreciated!
Create Event:
Draw Event:
Create Event:
Code:
global.control_lock = true;
instance_deactivate_all(true);
//Fade Variables
fade_alpha = 0;
fade_state = 1;//1 or -1, ie whether fading in or out
fade_speed = 0.02; //0.0025;
//Initialize Room Specific Variables
room_go_to = rm_frontend_rm2;
Code:
fade_alpha = clamp(fade_alpha + (fade_state * fade_speed),0,1); //0 and 1 are minimum and maximum number of clamp
if (fade_alpha == 1) { //when this has happened up to 1, go to next room
room_goto(room_go_to);
fade_state =-1;
}
if (fade_alpha == 0) && (fade_state == -1) {
instance_destroy();
}
//Draw Rectangle
var _xx = camera_get_view_x(view_camera[1]);
var _yy = camera_get_view_y(view_camera[1]);
var _Width = camera_get_view_width(view_camera[1]);
var _Height = camera_get_view_height(view_camera[1]);
if (fade_state >= 0) {
draw_set_colour(c_red);
} else if (fade_state < 0) {
draw_set_colour(c_black);
}
draw_set_alpha(fade_alpha);
draw_rectangle(_xx, _yy, _xx + _Width, _yy + _Height, false);
draw_set_alpha(1); //set it back