Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1
Chapter 23 ■ Completing the gameplay Code and player proofing your event handling

Do this same squareClickN = true; Java statement in the other three populateQuadrant() methods to
turn on the squareClick function, which will be turned off once a square has been selected for the current
round of gameplay. As you can see in Figure 23-35, the game now works properly. You can click the spinner
and squares not associated with the current quadrant, and the clicks will be ignored, as will clicks on any
Button after the first answer Button that is clicked. This “error proofing” or “player proofing” makes the i3D
gameplay much more professional.


Figure 23-34. Add a squareClick1 = true; statement at the end of populateQuadrantOne() and the other three
in the other three methods

Free download pdf