Decisions, decisions
Our Java code will constantly be making decisions. For example, we might need to know if the player has been hit or if they have a certain number of power-ups. We need to be able to test our variables to see if they meet certain conditions and then execute a certain section of code depending upon whether it did or not.
This chapter and the next will look at controlling the flow of execution of our game's code. This chapter, as the name suggests will discuss fine control over repeating sections of code based on predetermined conditions and the next chapter will look at branching to different sections of code, also based on predetermined conditions.
In the next two chapters, our code gets more in-depth and it helps to present it in a way that makes it more readable. Let's take a look at code indenting to make our discussion easier.