Game Development Reference
In-Depth Information
Planning for the larger picture
Now for small games, the preceding implementation is fine; however, if you are planning
a larger world with a large number of interactions, provide complex decisions to prevent
the player continuing unless they are ready.
As the following diagram shows, there are several paths the player can take and in some
cases, these is only one way. Now, we could just build up the logic for each of these indi-
vidually as shown in the screenshot, but it is better if we build a separate navigation sys-
tem so that we have everything in one place; it's just easier to manage that way.
This separation is a fundamental part of any good game design. Keeping the logic and
game functionality separate makes it easier to maintain in the future, especially when you
need to take internationalization into account (but we will learn more about that later).
Note
Now, we'll change to using a manager to handle all the world/scene transitions, and sim-
plify the tag names we use as they won't need to be displayed.
So, The Cave will be renamed as just Cave , and we will get the text to display from the
navigation manager instead of the tag.
So, by separating out the core decision making functionality out of the prompt script, we
can build the core manager for navigation. Its primary job is to maintain where a character
can travel and information about that destination.
First, we'll update the tags we created earlier to simpler identities that we can use in our
navigation manager (update The Cave to Cave01 and The World to World ).
Next, we'll create a new C# script called NavigationManager in As-
sets\Scripts , and then replace its contents with the following lines of code:
Search WWH ::




Custom Search