Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

C++ Windows App Development question?

So for my first "App" which is really a text based "your choices effect the outcome" game has hit a slight snag. I need some help with one bit of programming.

Say someone presses a button to select for that action to happen, what code do i put in in order for the display to change to the next story (I can't explain it any clearer, apologies) for instance if button_1 is pressed, load a new part of the story.

I already have the first title screen designed and implemented. I just need it so that once they've put in their name, it'll load the next bit of the story.

Also, would i have it so that each part of the story is a new C++ script? and then i use a command so that when the button is pressed it loads that specific script?

I just need to know that and i can finish this damn game haha any help appreciated (if you even understand what i need help with)

1 Answer

Relevance
  • 7 years ago

    This depends on how you've written the screen you've got and the screen you are planning to load, doesn't it? Assuming the top level window isn't going anywhere (maybe it's the full screen and can't go anywhere) you need have the new child frame or form or whatever container the next window ready to display, then turn off the old frame and turn on the new one.

    Maybe you can add fade in/out, scrolling or cross-fade effects later (depending on what your graphics platform will allow) but at the beginning you probably only want to blink one off an the other on, with the minimum amount of black time. That's why you get the new screen ready to go first.

    The phrase "C++ script" is going to make a number of programmers ill, but maybe you can make each section a separate chunk of code. If the game is large, you probably want to learn about DLLs and how to load and run code from them, so that the whole code base doesn't need to be in memory at once.

    A data-driven design is probably better. This is how a lot of classic games work. The old DOOM game had just just the game engine in the executable part and all the game logic was in the data file ("WAD file"). Even some text games did that. One of the grandaddy games was Zork, which did that to allow most of the game to be machine-independent.

    The code-based approach will probably be easier to code for small games, though.

Still have questions? Get your answers by asking now.