0 votes

I am using the Rect2 type to carve out rooms from my "map" which is just a large array.

I would like to be able to pick out a random wall tile every time I create a new room.

Before the actual spot is selected I have my map generator pick a random direction to go in (up down left or right) and based on this direction i pick a random wall tile to create a door from. For example, if the random direction is "UP" I would pick a random tile from the top wall of the previous room/Rect2 (which is stored in an array called "rooms").

Is there any way to do this using the Rect2 type?

in Engine by (30 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.