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

GameMaker (Solved) Metroidvania style room transitions

S

Spelfantast

Guest
Hi.

I am making a platformer game. However, at some places I want the levels to be more of a dungeon than a linear progression.

Right now as a placeholder I simply have an object that make the game move to another room when touching it. What I want though is a system that fulfills the following.

1. I want to transfer the player object to the right place in the room depending on which room he came from. ( I.e the right side of the room if he came from the room to the right)
2. I want this to be possible in rooms that have different sizes to each other. One room might be square, the one next to it is taller and wider.
3. If possible, I want the player to enter the room at the same vertical location he exited the last room. That is, if he is jumping to a room with the same floor that he jumped from, he should enter it in air.

Is there a good way to think of this?
Is it better that the dungeon is one big room that scrolls the view to new rooms or better to make it into different rooms? I've seen tutorials where it is one big room and the screen scrolls to new rooms like in Zelda 1, but I rather want it like in Super Metroid, or even more games where you can enter rooms in a jumping state.

Do you have any recommendation how to approach it? Where should I look?

Very much thanks in advance!
 
D

Danei

Guest
I do this with one small room. When the player touches the edge, I draw the screen to a surface, then load up the stuff in the next room, make it invisible, but draw it to a surface too. Then over the next few frames, I draw the first surface sliding out and the second one sliding in. While that's happening the player character is in a frozen state and is moved rapidly to the opposite side of the room from where he came from.

Then when the transition is complete, I get rid of those surfaces, make the actual stuff visible again. and unfreeze the player.
My "rooms" are all the same size, and again it's just one room, but you could do this with different rooms and/or differently-sized rooms as well, as long as you account for where in the new room you need to place the player, and which part of that room you therefore need to draw on the surface.
 

TheouAegis

Member
Other classical in Metroid allowed the enemies in both the old room and the new room move while the player transitioned. That's a fun little experiment with global arrays. lol
 
Jumping between rooms is the best!! I have made a game that does this, using objects that are probably similar to the placeholders you already made. These would be placed at the "start" and "end" of a stage, and always positioned so the y-origin of the object was at ground level. When the player collides with the object, I note its height relative to the object, and store that. When the player is generated into the next area, it's placed at the starting location, plus whatever difference there was between the player and the exit. Easy! You do need to make some design decisions around something like this, because you don't want the player jumping out of one room and directly into the ceiling of the next.

If you have vertical transitions between stages that have any significant width to them (ie, not a player-wide doorway, like a Zelda dungeon), you'd probably want to implement something similar along the X-axis, too.
 

RangerX

Member
Using your objects that you touch when exiting rooms, you could set a position into some global variables. Then when the player starts in the next room, he moves itself to that position.
 
Top