Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1
Chapter 22 ■ SCoring engine: Creating the SCore Ui LayoUt and SCoring the Content

Figure 22-28 shows a Run (^) ➤ Project work process used to render a rightAnswers Text object and
its settings.
The other Button elements use similar code, only they’ll add one to a wrongAnswer int variable. This
means you’ll copy the a1Button construct you created three times underneath itself, changing a1Button
to a2Button through a4Button. Change rightAnswer to wrongAnswer and change rightAnswers to
wrongAnswers, as shown in Figure 22-29.
Figure 22-29. Copy and paste a1Button construct three times underneath itself and change the object and
variable names
Figure 22-28. Use a Run ➤ Project work process to preview the Score panel and the rightAnswers Text object
placement

Free download pdf