Chapter 17. Captain Chloride Encounters Solid Objects


This chapter continues the work of implementing the sample game, Invasion of the Slugwroths. In the previous chapter, you saw how to add Captain Chloride to a level. Because the world he existed in was nothing more than a background, our good Captain could walk right through doors and walls. In this chapter, I'll show you how to fix that. First, I'll explain how to use sprites to make the Captain bump into a door. Next, you'll learn how you can make Captain Chloride pick up keys. Finally, I'll demonstrate how to make the door open and close. If Captain Chloride doesn't have the key, the door won't open. If he does, it slides up to admit him inside.



Creating Games in C++(c) A Step-by-Step Guide
Creating Games in C++: A Step-by-Step Guide
ISBN: 0735714347
EAN: 2147483647
Year: N/A
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net