Pro Java 9 Games Development Leveraging the JavaFX APIs

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

As you can see in this phase of the gameplay design and programming, the primary objective is
selecting the best Button answer labels and “wiring” them correctly to the setupQAprocessing() scoring
engine method so that the scores are calculated correctly! This is why I suggest coding each game board
square one at a time and tying them to the setupQAprocessing() scoring engine method carefully! Make sure
to test each game board square well enough so that you can make sure a click on the correct answer button
adds 1 to the “Right:” score label’s integer text value.
As you can see in Figure 23-5, I have added the scoring engine method’s Java code to evaluate these
answers, which is shown highlighted in yellow. I selected the Q1S2 Box (square) object in the code to
highlight references to it.


Figure 23-5. Add matching correct or incorrect answer score processing to the createQAprocessing() method
for Q1S2

Free download pdf