Game Development Reference
In-Depth Information
Designing a Program with a Flowchart
This game is a bit more complicated than the ones we've seen so far, so let's take a
moment to think about how it's put together. First we'll create a flow chart (like the one at
the end of the Dragon Realm chapter) to help us visualize what this program will do. A
flow chart is a diagram that shows a series of steps as a number of boxes connected with
arrows. Each box represents a step, and the arrows show how one step leads to other steps.
You can trace through the flow chart by putting your finger on the "Start" box of the flow
chart and following the arrows to other boxes until you get to the "End" box. You can only
move from one box to another in the direction of the arrow. You can never go backwards
(unless there is a second arrow going back, like in the "Player already guessed this letter"
box below.) Here is the complete flow chart for the Hangman game (Figure 8-1).
Figure 8-1: The complete flow chart for what happens in the Hangman game.
Of course, we don't have to make a flow chart. We could just start writing code. But
often, once we start programming, we will think of things that need to be added or changed
Search WWH ::




Custom Search