So far, the nextStory method covers what should happen if the user needs to progress through the story. But what should happen when they reach one of the end points of the story, namely story 3, 4 or 5?

//TODO: Step 22 - In nextStory() if the storyNumber is equal to 3 or 4 or 5, that means it's the end of the game and it should call a method called restart() that resets the storyNumber to 0.

HINT: You'll need to add some conditions to the nextStory() method to achieve this.

Step 22 SOLUTION


//TODO: Step 23 - Use the storyNumber property inside getStory(), getChoice1() and getChoice2() so that it gets the updated story and choices rather than always just the first (0th) one.

Now that we have a storyNumber that tracks where the user is at in the storyline, it's time to put it to use in the methods that get the information for our screen. So instead of always just showing the 0th story, first choice and second choice, we need to update it using the storyNumber.

Step 23 SOLUTION


//TODO: Step 24 - Run the app and try to figure out what code you need to add to this file to make the story change when you press on the choice buttons.

If you run your app at this stage, you'll see that nothing happens when you press on the choice buttons. Why is this?

HINT

Step 24 SOLUTION