Game Development Reference
In-Depth Information
For this chapter, we'll just give it a one track mind to follow the player. With
Root
se-
lected, click on the
Action
button under
Leaf
, as shown in the following screenshot:
Sinceweonlyhaveoneactioninthebehaviorlist,itselectsitbydefault.Whatmakes
the behavior tree nice is that we can make decisions, or check whether the target is
within X distance then try to follow, otherwise do something else-all from the design-
er. The next section on RAIN also uses a behavior tree, and most of the same basic
types are used in both RAIN and React.
This took more steps than the previous AI, but there is also more going on. It is play-
able now.
Tip
Downloading the example code
You can download the example code files from your account at
ht-
tp://www.packtpub.com
for all the Packt Publishing topics you have purchased. If
you purchased this topic elsewhere, you can visit
http://www.packtpub.com/sup-
port
and register to have the files e-mailed directly to you.