Archived

This topic is now archived and is closed to further replies.

Question for Jim Adams

This topic is 5777 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I bought your book and loved it, but I had a couple of questions regarding the topics if you could answer them for me. First I didnt entirely understand is what you were tying to do with your cStateManager class, and I was hoping that could be cleared up a bit. From what I see it''s really only nessesary if you have a of states and you need to be able to get into and out of them quickly right? I''m wondering this because my game should have only 3 to 5 ''states'' and if I shouldnt have any problem with the switch statement I wouldnt want the extra code in there. Also, I was wondering if you could tell me how to implement an ICS where you can place a ''backpack'' on the back of a character, and more items inside of it. I''m guessing that you simply charICS::add() a backpack to the character with a null parent and then add() items into it with the backpack as the parent argument right? ~Vendayan

Share this post


Link to post
Share on other sites
quote:

First I didnt entirely understand is what you were tying to do with your cStateManager class, and I was hoping that could be cleared up a bit. From what I see it''s really only nessesary if you have a of states and you need to be able to get into and out of them quickly right? I''m wondering this because my game should have only 3 to 5 ''states'' and if I shouldnt have any problem with the switch statement I wouldnt want the extra code in there.



Well, if a simple switch statement works best for you, then by all means go for it! But just consider some of the following scenarios - you can doing a full-fledged RPG with a spell screen, invenotry screen, quest jouneral screen, option menu screen, secondary option menu screen, character statistic, character skills, character background...the switch statement will cause some troubles.

The other thing I would like to point out is how much more flexible your game will be. State-switching can lead to some confusing code at times (take a look at the Donuts3D game that comes with the SDK samples).

For another reason, look at the Windows programm resources that say something like "Avoiding the message pump."

Share this post


Link to post
Share on other sites