• 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!

Random room

U

Umut

Guest
Hi guys, I've been using GM for about couple of weeks now so I decided to start simple

I'm making a quiz game for kids. Each room has a question with answers. When the game starts there's a "start game" button and when it's pressed the player starts in a random room. The problem is some rooms need to go to "next room" NOT random. I mean you can't start at "rm_question3_end" or "rm_question3" because you must go to "rm_question3_intro" first right?

rm_question1
rm_question2
rm_question3_intro
rm_question3
rm_question3_end
rm_question4
rm_question5
rm_question6
ect.

Can you please tell me how I can make all rooms random but not some?
 
C

Ctl-F

Guest
room_goto(choose(/*list of rooms here*/));

Eg:
room_goto(choose(rm_question1, rm_question2, rm_question3, ...));

This method let's you list exactly what rooms can be chosen.

The choose function picks a random item from the list you pass it.


As for the intro bit, pass the intro in (and not the question not the end) and when that room is over room_goto(question) and when the question is over room_goto(qend) and then go back to the random.

Note: this can and will repeat rooms as is.
 
U

Umut

Guest
room_goto(choose(/*list of rooms here*/));

Eg:
room_goto(choose(rm_question1, rm_question2, rm_question3, ...));

This method let's you list exactly what rooms can be chosen.

The choose function picks a random item from the list you pass it.


As for the intro bit, pass the intro in (and not the question not the end) and when that room is over room_goto(question) and when the question is over room_goto(qend) and then go back to the random.

Note: this can and will repeat rooms as is.
That's working Perfectly. Thank you.
 
Last edited by a moderator:
Top