P
PantsOfAwesome
Guest
I have tried to add a menu system that draws when the player dies in my game, but when choosing an option, the highlighted option's highlight appears with a slight delay and I have no idea why. Here is the death object obj_death.
Here is the create event code:
Here is the step event code:
And here is the draw event code:
I know the draw code is a bit stupidly made but I was just playing with it untill I got the sizes and positions that I wanted. By the way, I wanted to know if anyone knows a way to make the rectangle drawn stay semi transparent while the text stays as it is.
Thank you in advance!
Here is the create event code:
Code:
depth = -1;
choice = 0;
move_choice = 0;
Code:
key_up = keyboard_check_pressed(vk_up);
key_down = -keyboard_check_pressed(vk_down);
key_choose = keyboard_check(vk_space);
move_choice = key_up + key_down;
choice += move_choice;
if(choice < 0)
choice = 1;
if(choice > 1)
choice = 0;
Code:
draw_set_alpha(0.25);
draw_set_color(c_black);
draw_rectangle(0,0,room_width,room_height,false);
draw_set_halign(fa_center);
draw_set_valign(fa_middle);
draw_set_alpha(1);
draw_set_color(c_white);
draw_set_font(fnt_death_large);
draw_text(room_width/2, room_height/2, "YOU DIED!");
draw_set_font(fnt_death_small);
draw_text(room_width/2, room_height/2 +50, "CONTINUE");
draw_text(room_width/2, room_height/2 +100, "QUIT");
if(choice = 0)
draw_rectangle(room_width/2-80, room_height/2+34, room_width/2+15*4+16, room_height/2+64,true);
if(choice = 1)
draw_rectangle(room_width/2-49, room_height/2+84, room_width/2+15*2+16, room_height/2+114,true);
Thank you in advance!