GMS 2 the kill score doesn`t appear when i kill an enemy

kassmass

Member
so i wanted to make a counter for the pointless murders i have commited in my game, and the text doesn`t show up, here`s the code in the create event:



#macro resw 1024
#macro resh 768
display_set_gui_size(resw,resh);

global.kills = 0;
global.killsthisroom = 0;
killtextscale = 1;




and here`s thecode in teh draw GUI event:


if (room != menu) and (instance_exists(o_player)) and (global.kills > 0)
{
killtextscale = max(killtextscale * 0.95, 1);
drawtext(c_black, font1, fa_right, fa_top);
draw_text_transformed(resw - 8 , 12, string(global.kills) + " Bad Guys Killed", killtextscale, killtextscale, 0);
draw_set_color(c_white);
draw_text_transformed(resw - 10 , 10, string(global.kills) + " Bad Guys Killed", killtextscale, killtextscale, 0);
}



can someone help?
 

rIKmAN

Member
yes, it is the exact code, and yes i have made a script called "drawtext"
Add a show_debug_message() inside that if check.
If it prints the message to the console the issue is with the draw code, if it doesn't then the issue is the if check itself.
 

kassmass

Member
i fixed it XD, al i had to do was drag the 'game" object to the playable rooms. the tutorial i was watching only dragged it to the menu.
thanks anwyays guys!
 
Top