# Mechanic - Player Can Change The Map

I have a RogueVania game in development and I just found a great mechanic to add to it!

I recently found the short game Allocation by Mush and I love how the main mechanic is to let the player collect room pieces to create the game’s layout! Play it here on Ichi for free!

I won’t try to replicate it exactly from Allocation, but give my own ideas for the mechanic.

I’m currently taking a break from my other game project to work on this and I wanted to make posts about my progress to motivate myself and maybe show other devs how they can make this mechanic!

Here’s what I’m gonna need first:

• My platformer character
• An object to show the map
• The map layout/GUI
• Map Pieces to put into the map
• Rooms that represent these pieces that our character can explore

I might need more or less stuff as time goes on.

The Enter 4 Map box I made is the object the player needs to collide with in order to access their map. I also had to make sure that the player can’t move when they try to access the map.

I called my Map Layer “Compass”

I made my map on a external Layout like I would make a regular menu or pause screen. I really loved the Mao Kun Map from Pirates of the Caribbean 3 and I wanted to make it off of that.

The idea is that you use keys to select a ring and then you use other keys to rotate one clockwise or counterclockwise. The black and blue dots represent a room and the black lines represent a path. If you can line up the lines to rooms, then the player can access them.

Now I need to make the rooms and make it so my player gets access to them.

Today, I made the doorways. The black lines are supposed to be when the door is shut and the light is supposed to be when the door is opened. I also added the DoorName Object variable.

I gave the first ring a Number Variable. I basically copied what I did for the PathSelect scene variable. The first ring rotates at 90 degrees, so it has 4 rotations. When the ring’s number variable hits either 5 or 0, it will instead change to 1 or 4 so the variable always stays between 1-4.

I did that because when the variable is a certain number, I can make certain doors open or lock.

On the rings, there are blue dots and black dots. The dots are basically representing rooms and the black dots are inaccessible rooms at the start of the game. The player needs to collect something to unlock them one by one.

In the screenshot above the black dots have two variables. The MemState variable records whether the player can enter the rooms the black dots represent and I’ll use the MemName variable to name each dot so I can make sure only one room at a time becomes accessible.

I also made a Global Number Variable that will keep track of how many rooms the player can unlock. This is because the player unlocks rooms through performing (platforming) events, not collecting an object.

I’ll have to think up one or two events so I’ll stop here and work on that this week.

whoops, I worked on this a few days ago and forgot to update. And then Gdevelop had a shiny new update woot!

In the screenshot above, I made a simple mission: When the player completes a specific task (like shooting a certain enemy), the Global Variable called Memories goes up one.

Each memory will unlock a certain room - and you have to shift the rings around the map to get to it and see what goodies you’ll get!

Another thing, too. I have another object I lay over the rooms called Blackout. Basically, when you aren’t in the rooms, you can’t see what’s in it. It’s only when you get in the rooms that they’ll reveal themself.

I think that I’ll tweak the coding for this part later, but my next step is now making things move around.

After some thinking, I decided that I’m not going to make the rooms themselves move, but just the hallways. I was thinking of having a different scene that’s the hallway area. Whenever you go through an open door, you’re transported between the two scenes. The hallway area will rotate with the ring’s setting, so I’ll have to really think about level design because I don’t want the character getting stuck.