QA


Q&A

Q1:

Why was it necessary to add the SpriteDying() function to the game engine?

A1:

The SpriteDying() function is important because it provides a means of carrying out a particular task in response to a sprite being destroyed . Keep in mind that the sprites in the game engine in many ways coexist in their own little world, and at times it can be difficult to interact with them because they are shielded from you. One of the limitations of the game engine prior to this hour was that there was no way to know when a sprite was being destroyed. The SpriteDying() function gives you a glimpse into the "sprite world" and lets you know whenever one of them is being killed . In the Meteor Defense game, this is important because it allows the game to create an explosion whenever a meteor is destroyed.

Q2:

How does the _iDifficulty global variable control the difficulty level of the Meteor Defense game?

A2:

The _iDifficulty global variable is used to determine how often new meteors are added. To make the game harder, you just add meteors more rapidly , which is carried out in the game by decreasing the value of the _iDifficulty variable in response to the score getting higher.



Sams Teach Yourself Game Programming in 24 Hours
Sams Teach Yourself Game Programming in 24 Hours
ISBN: 067232461X
EAN: 2147483647
Year: 2002
Pages: 271

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