.Netterpillars: Artificial Intelligence and Sprites, Part 2 - Further Improvements
(Page 11 of 11 )
We saved the best for last: What about creating new intelligent characters for your game, maybe some opposition—like a spider who eats the netterpillars?
In the code for this chapter on the samples CD-ROM, you will find an almost fully working spider character. You already did all the dirty work: The Spider and AISpider class interfaces, the call to the moving functions at the MoveComputerCharacters routine and at the Render and Redraw method of the objGameEngine—almost everything is there. The code for ChooseDirection method of the AISpider class is empty, so your spiders aren’t going anywhere. This gives you the opportunity to create the AI from scratch, without worrying about the details. Will the spider attack the netterpillars’ heads and kill them? Or will they just eat part of their tails? Or, maybe make new mushrooms grow? Start making your proposal for the second version of the game, and enjoy!
Summary In this chapter, via the .Netterpillars game sample, we explored some additional concepts related to game programming, including:
- Basic concepts about object-oriented programming and analysis
- Basic concepts about artificial intelligence, and ideas about how to implement it to solve different challenges when programming games
- The difference between game AI and game physics
- How to create a basic objects library and use its derived classes in games
- How to produce high-performance drawings with GDI+, when you need to draw images with transparent colors
- How to create computer-controlled characters that interact with the game engine like player-controlled characters, with the same physics restrictions
In the next chapter, we’ll introduce you to the use of DirectX graphics with a sample program that will test many of the basic features of Direct3D, so you can use these concepts in the example games in later chapters and in your own games.
Acknowledgments The authors would like to thank Steven Toub, who assisted in the conversion of the .Netterpillars game.
This chapter is from Beginning .NET Game Programming in C# by Ellen Hatton et al. (Apress, 2004, ISBN: 1590593197). Check it out at your favorite bookstore today. Buy this book now.
|
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |