How do I get into a random room out of a variety of rooms I created? [Resolved]

0 favourites
  • 5 posts
From the Asset Store
An Action RPG Platformer. Strengthen your HP, Mana, Stamina, and energy as you level your player up.
  • Hey! ^_______^

    I create a Roguelike game where my character enters a room, performs actions in it (defeats all the enemies) and then a door to a new room opens for her.

    I created the rooms (room 1 room 2 room 3) and I want to make him every time he walks in the door he comes to a random room out of the three I created.

    I also want to create that once he enters the room and completes the task in it - he will not be able to enter this room again.

    For example my character went into room 2 - defeated all the enemies in it and came to move to another room - I wish he could now randomly enter only room 1 or 3 and not room 2 again.

    Say he entered room 1 after that - defeated all the enemies in it and now he has to get to another room - now he will only be able to enter room 3 - because rooms 1 and 2 he has already passed.

    I would be very happy if you could explain to me how I do something like this. I just can't figure out how to make something like this happen.

    Thanks so much in advance I really appreciate it!

    Tagged:

  • You can use AdvancedRandom plugin to create a non-repeating random list of rooms:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks so much for the comment I appreciate it

    But unfortunately I tried it and it does not work - he puts me in the first room, then he does not go through the door to the next rooms he just ... there ... in the worst case he also gets stuck ....

    I tried to read about the random but could not understand - probably it's too sophisticated a language for me ....

    Should I put it in every EVENT SHEET or in the general one I did (which of course I add to everyone using "include EVENT SHEET")

    Thank you! Appreciate it

  • This code may be in the general sheet. Make sure it's included in all layouts. Double-check that you made everything exactly as in my screenshot. If it doesn't work, please post your project file.

    .

    Sorry, forgot to add - your room layouts should be named Room0, Room1, Room2.

    Or you can change the action like this:

    Go To Layout "Room" & (AdvancedRandom.permutation(permutationIndex)+1)

    then you can name layouts Room1, Room2, Room3.

  • I thank you from the bottom of my heart!

    It solved my whole business like magic (the problem was really in "Room 0")

    I appreciate it very very much! Thank you very much!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)