• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Quick question for help ;) (ask for multiple rooms)

Darnok

Member
if(room = Leaderboards || lb_tutorial || lb_level_1 || lb_level_2 || lb_level_3 || lb_level_4 || lb_level_5)
{
//draw the leaderboard
draw_leaderboard(room_get_name(room),32,32);
}

how can i check for all these rooms at once without listing them like that?

thx ;)
 

FoxyOfJungle

Kazan Games
Enable the object's persistent option.
Use a variable to enable the draw of this text, if it's true, draw it. You can turn this variable on in each room, and in Room End it off.
 

Darnok

Member
sorry i dont really understand with the object you mean the room or the object that draws ? and what dose presistent do ? thx
 

FoxyOfJungle

Kazan Games
Put in the object, that draws, the one you edit code, in the Game Maker IDE.

When an object is persistent, it is not destroyed when changing rooms, even when you manually destroy it.

There are several ways to do what you want. I would particularly put them all in an array and then do a loop, if the value is equal to the room variable, I activate the text.
Or simply use a switch the Create Event.
 
Last edited:

TsukaYuriko

☄️
Forum Staff
Moderator
if(room = Leaderboards || lb_tutorial || lb_level_1 || lb_level_2 || lb_level_3 || lb_level_4 || lb_level_5)
{
//draw the leaderboard
draw_leaderboard(room_get_name(room),32,32);
}

how can i check for all these rooms at once without listing them like that?
You can't do that in the first place. I mean, you totally can, but it won't do what you think it does or want it to do.


Misguided Belief #1.
 
Top