Continuing the Logic
I will multiply these at the start of the layout.
And the reason is that I’m just going to separate each ID into different areas. We might combine them to see if it works. And for you to understand it better, I’m just going to separate everything here. Now we will add on the start of the layout here and add a System sub-condition; For Each Room as parameters for System.
For Each Room we’ve created, we will go to Room and spawn another object, the Hallway.
For Each Room here, we need to add a RoomCenter sub-condition; compare the instance variable of the ID as parameters for RoomCenter.
So compare, for instance, the variable is an ID (number) equal to, and the value is the Room.ID + 1.
Then we will set the Hallway size.
We need to set the position of the Hallway.
That’s all we need there. We next need to add another sub-condition to this at the start of the layout.
Now, this System sub-condition will be again the For Each.
And by the way, so what the first one does is it spawns one of the Hallways.
So one spawns the horizontal Hallway, and the other generates the vertical Hallway.
So, it’s the same thing. I will copy the first one, but it’s slightly different.
And let’s add a sub-condition to the second as well.
Let’s compare the instance variable; that ID (number) will equal Room.ID + 1.
It’s almost the same. So I will copy and paste the first one.
These aren’t the same.
So what we’re doing here is setting up For Each of these Rooms. The next thing we’ll do is add another one at the start of the layout. And we’ll do that in the next test where we set the borders.