Game Development Reference
In-Depth Information
Checking Our Player's Directional Facing
We need a way to make sure that the player is facing the right way. Enter the Conditional Branch once again. Up
to now, we have been using conditional branches almost exclusively to check against variable and switch values.
However, there are three more pages full of things that you can check against. If you click page 3 of the conditional
branch command, you will find the Character X is Facing Y conditional. X defaults to the player but can also check for
every single event on the current map, and Y is the direction the player or event in question is facing. Here's the first
part of the relevant event from my end:
@>Conditional Branch: Player is Facing Right
@>Conditional Branch: Variable [0002:X] == 44
@>Text: -, -, Normal, Bottom
: : You see a majestic dragon statue. It hums with
: : power.
@>Text: 'Actor5', 6, Normal, Bottom
: : I sense immense power emanating from this
: : statue. Be mindful. It would be best to
: : return at a later time.
@>Text: -, -, Normal, Bottom
: : Touch the statue?
@>Show Choices: Yes, No
: When [Yes]
@>
: When [No]
@>
: Branch End
@>
: Branch End
@>
: Branch End
We set up a conditional branch to ensure that the player is facing to his/her right. Afterward, we make sure that
X is equal to 44 (which it will be, if the player is standing next to the statue's two left squares, which is assuming,
of course, that you have not tweaked the size of that particular map). If both conditions check out, we display the
relevant text and give the player a choice. As you can already tell, I have left both possible answers empty. I'll leave
that as an exercise for you for now. We'll revisit this one much later in the topic, as we put the finishing touches on our
game. Anyway, take a look at Figure 6-5 for the tweaked third floor of our second dungeon. The base sample map used
was Tower of the Void F5F.
 
Search WWH ::




Custom Search