QA


Q&A

Q1:

Because the frame rate isn't important for the Brainiac game, why can't it be set to ?

A1:

This is one of those questions that is best answered by trying out the suggestion. If you try to pass into the SetFrameRate() member function of the game engine, you'll get a "Divide By Zero" exception because the frame rate is divided into 1,000 ( milliseconds ) in order to calculate the delay for each game cycle in the game engine's timing loop. So, passing isn't an option unless you modify the game engine so that it reacts differently if is specified as the frame rate. Although this is certainly an option, having a frame rate of one doesn't really hurt anything, and it keeps you from having to add conditional code for a frame rate.

Q2:

What is the purpose of setting the tile selection variables to -1 ?

A2:

A -1 setting for the tile selection variables indicates that they haven't been set to a specific tile. This is a clue to you that a tile selection hasn't been made; otherwise the tile selection variable would have a value in the range of to 3 . (The array contains four elements.) The game code can therefore quickly tell where the user is at in terms of selecting tiles by looking for a value of -1 , which indicates that a selection has not yet been made.



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