Game Development Reference
In-Depth Information
For the boss, we have defined some initial nodes to be used during its initial drop
at the start of the battle, which allows us to control where he goes. This doesn't
do much aside from moving the boss to its initial starting point, but it could be
expanded to make the boss fly around, jump about, or do whatever you desire.
Need another challenge? We just mentioned giving the boss
an introduction sequence. Have a go at it!
Next, we have something new—a List object called dropNodeList . A list is essentially
a container, like an array. Unlike an array though, you can use functions in a list to
quickly search and see if it contains objects, add objects, pops them out, and—the best
part—it's way faster than an array while working with numerous objects.
Need to know more about C# object types? Check out the Microsoft
Developer Network located online at http://msdn.microsoft.
com/ . From there, you can get all sorts of resources, including
information about object types! Just type something, for example,
List , in the search box, and you'll be educated in no time.
The dropNodeList object allows us to define a bunch of target nodes for the boss
to drop to, without needing to know how many nodes there will be. Note that to
use the List object type, we have to add the following code at the beginning of
the script file, which you should have already done:
using System.Collections.Generic;
You will now want to add these nodes to the game world. Nodes can simply be
a GameObject with nothing more than a Transform , or if you want to be able to see
them, create a sprite image just for the purpose of displaying them. Create a node for
dropToStartNode and another for inActiveNode . Place the dropToStartNode object
on the platform you want the boss to first drop towards, and place the inActiveNode
object directly above it, only high above so that it can't be seen in normal gameplay.
To make node alignment extra clear, use the boss sprite itself—then there's no
question as to where the boss will land! Just be sure to add a quick component that
will hide the sprite when the game begins!
 
Search WWH ::




Custom Search