Graphics Reference
In-Depth Information
Figure 15-30
Full bad-guy motion logic
Notethatifyouwatchthebadguysinactionfromthetopview,theweaknessesoftheveryrudimentarypath-
findingalgorithmusedherequicklybecomeapparent.Thebadguysoccasionallygetstuck,andtheirmovement
becomes predictable. Nevertheless, the basic techniques described in this section will enable you to implement
much more robust and sophisticated path-finding algorithms of your own.
Collecting Treasure and Racking Up Points
If you open the
game.blend
file on the website for this topic, you'll see the final game setup along the lines
of
Figure 15-31
. (The color insert in this topic shows these figures in color.) I've placed three BadGuy objects
onthepath,oneofthemgoingtheoppositedirectionfromtheothertwo(thatistosay,oneofthemhasaninitial
inc
property value of 1, whereas the others have a value of 0). You'll also see eight yellow cones and three
green balls.