摘要: A gaming world is nothing without players and monsters running around.
Nevertheless, creating them can be a little daunting at first. But don’t worry.
In this chapter, you can find the basic information you need to create characters
and give them a life of their own in your game—all in an easy-to-follow format.
In this chapter, you learn how to do the following:
阅读全文
摘要: All your hard work is about to pay off with a demonstration of the character and
spell controllers seen in this chapter.
Upon executing the program, you see the scene shown in following snap.
阅读全文
摘要: Things are winding down with the controller at this point. You use the following
functions to equip, use, and drop an item:
阅读全文
摘要: Once characters take enough damage, they die, and when that happens, the following
function is called:
阅读全文
摘要: Coming up is a huge collection of functions you use to retrieve and set the specific
information about a character (related to the artificial intelligence functionality or
actions):
阅读全文
摘要: Whenever a character needs updating, rendering, or what have you, a pointer to
the linked list of characters is needed in order to iterate the list. Either that or
maybe your application needs access to the character data. Either way, the following
functions will help you out:
阅读全文
摘要: Notice that I keep talking about removing characters from the list. What about all
the hard work you’ve put into your PCs—how are you ever going to store their
achievements for later loading? With the following set of saving and loading functions,
of course!
阅读全文
摘要: You're coming to the end of the long haul. You’ve finished the private data and
functions, and the public functions are left:
阅读全文
摘要: Once it is determined what action each character wants to perform, that action
must be validated. Characters moving around can’t walk through other players
(except for PCs, who can walk through other PCs). Also, depending on your levels,
you use a function to determine character-to-map collisions. These two validation
functions are as follows:
阅读全文