DOOR TUTORIAL

This tutorial will teach you how to make a door open and have it close behind you.

In this tutorial, I will show you how to make a door without having to teleport to specific spot on a map where the door event is in. One cool feature this event will have is closing it behind you after you walk through the door. How do you accomplish this? Well, we should make an event and we'll start from there.

Part 1: Setup
This part is pretty simple, just set the graphic to a door sprite and set the event layer as: Same layer as hero. Also have the trigger condition as Touched by hero (so when you press up or down, the door will open without having a conditional branch detecting if the player is facing up or down.)


Part 2: Opening and Closing the door
This is where you'll need to pay attention. We'll be using the move event command a bit for the animation of the door opening and closing.
The first thing we should do is have a sound effect of the door opening.
Next, we make the door opening by using the move event command:
NOTE: Have the event name set to This Event.
<> Face Down

<> Wait
<> Face Right
<> Wait
<> Face Up
<> Wait
<> Face Left
<> Wait

Okay, we completed the first part of the event. Now, we need to have the player go through the door after the door is completely open. First, we'll put the wait event and set it to 10 tenths of a second (or wait 1.0 seconds.)
<> Wait: 1.0 Sec

Then, we make the player move through the opened door:
NOTE: Have the event name set to Hero.
<> Phasing Mode ON

<> Move Forward
<> Move Forward
<> Phasing Mode OFF

Now, use the wait command again.
<> Wait: 1.0 Sec

Alright, the second part is done. On to the last part!
After you added the second wait command in the Event Commands section, we'll add two more things and we're done. Play a sound effect of the door closing, and we'll use the move event command one last time for the door closing:
NOTE: Have the event name set to This Event.
<> Face Left

<> Face Up
<> Face Right
<> Face Down

Guess what? You're done! Now you know how to make a door open, have the player go through the opened door, and have it close behind you.

Got any questions about this tutorial? Feel free to contact me anytime.