Game Development Reference
In-Depth Information
Completing the Treasure Chest Game
Last, but definitely not least, we have the Parallel Process event. We have to make sure that we end the game right
when the player has opened the second chest, lest he/she get greedy and open all seven of them. Also, we have to
make it so that the player is temporarily removed from the map, so that the chosen chests can reappear for future
play-throughs of the minigame. We can do this via the clever use of a switch that I'll call Intermission. The Parallel
Process event is one page long and needs to have a condition of TreasureChestStart is ON (otherwise the player will
loop infinitely between the two maps). The Parallel Process event starts with a conditional branch that requires that
ChestsToOpen be equal to 0. Then, it checks for Intermission to be off (which it should be). The NPC will say “That's
it!” and the screen will fade out. The player will be transferred to a nearly blank map that contains a small Autorun
event that flips on the Intermission switch and sends the player back to the Treasure Chest game map (specifically,
one square to the south of the NPC and facing the player).
Back at the game map, the Parallel Process event has a second conditional branch that only triggers when
Intermission has been turned on. We take a one-second pause and turn off the TreasureChestStart and
Intermission switches, effectively resetting the minigame state so that the player can play again. Here's the Parallel
Process event:
@>Conditional Branch: Variable [0010:ChestsToOpen] == 0
@>Conditional Branch: Switch [0020:Intermission] == OFF
@>Text: -, -, Normal, Bottom
: : That's it!
@>Fadeout Screen
@>Transfer Player:[014:Intermission] (007,006), Up, None
@>
: Branch End
@>
: Branch End
@>Conditional Branch: Switch [0020:Intermission] == ON
@>Wait: 60 frame(s)
@>Control Switches: [0019:TreasureChestStart] = OFF
@>Control Switches: [0020:Intermission] = OFF
@>Fadein Screen
@>
: Branch End
The Autorun event on the intermission map is made up of two little lines:
@>Control Switches: [0020:Intermission] = ON
@>Transfer Player:[013:TreasureChestGame] (008,007), Up, None
Related Exercises
With that done, you have just completed your very own treasure chest game in the vein of some of the Zelda games.
Here are some neat exercises for you to try out that are related to this particular minigame.
1.
Using the “Item exists” conditional of an event, make it so that the player can see the item
that a particular minigame chest contains.
The inspiration for this one comes from
Ocarina of Time . In that particular Zelda entry,
the player can see the contents of chests in a minigame, by using an item found at the
bottom of a well.
 
Search WWH ::




Custom Search