Game Development Reference
In-Depth Information
Figure 6-3 is a highly zoomed-in screenshot of the dragon statue and its surrounding squares. You'll want the
X and Y values to draw the effective perimeter. Check the following code to see what I did for that first part.
@>Control Variables: [0002:X] = Player's Map X
@>Control Variables: [0003:Y] = Player's Map Y
@>Conditional Branch: Variable [0002:X] >= 43
@>Conditional Branch: Variable [0002:X] <= 46
@>Conditional Branch: Variable [0003:Y] >= 25
@>Conditional Branch: Variable [0003:Y] <= 27
@>Jump to Label: Step 2
@>
: Branch End
@>
: Branch End
@>
: Branch End
@>
: Branch End
So, as usual, we write the player's position into a pair of variables and then check against the current map
coordinates to see if they are in the dragon statue's perimeter. If they aren't, nothing happens. If they are, we have a
label called Step 2 that continues the event. Here's the next part of the event:
@>Conditional Branch: Variable [0078] >= 999
@>Label: Step 2
@>Conditional Branch: Variable [0002:X] == 43
@>Conditional Branch: Variable [0003:Y] >= 25
@>Conditional Branch: Variable [0003:Y] <= 26
@>Control Variables [0002:X] += 1
@>Set Event Location: [DragonTopic], Variable [0002][00003]
@>Jump to Label: Done
@>
: Branch End
@>
: Branch End
@>
: Branch End
@>
: Branch End
Moving Our Interaction Event
We have two new things in the perimeter-establishing event that are of interest.
First, we have a dummy variable (that has a set value of 0), and we have the system try to
resolve the branch if said variable is greater than or equal to 999. As we are not writing
anything there, this branch will never be true. So, why have it at all? Remember: Events
execute from top to bottom, unless prevented from doing so. We have this dummy branch
here so that the rest of the event will only execute when we use the Jump to Label command to
jump to Step 2 inside of the branch itself.
 
Search WWH ::




Custom Search