In this project, I show you how to convert the single-player version of Capture the Flag to multiplayer. Playing Capture the Flag by yourself isn’t much fun — you need to have at least one other player. Before reading this project, complete all the code instructions from Project 8. Your code example should look like Figure 8-73. Then test all the code you wrote in Project 8.
First I show you how to change the gameplay loop to include the second player and how to iterate over the code to add the second player to each function. This ensures that the second player is also getting a wand, getting respawn locations, and being able to respawn at the respawn location.
Look at the gameplay loop shown in Figure 9-1 (and defined in Project 8): It shows that you have completed all steps in the Start phase and you’re facing a new challenge — adding Player 2 to the game.
After you add a second player, you need to add a way to beat the game. In this project, I walk you through the last two iterations of the gameplay loop: adding player two and making someone ...