Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1

Chapter 17 ■ i3D Game Square SeleCtion: uSinG the piCkreSult ClaSS with 3D moDelS


Let’s use a Run ➤ Project work process and test our code. Click the Start Game Button object and
notice that the screen contains only the game board. The spinner UI then appears, rotating into place (to the
wrong “PINS” position, which we will fix soon). When you click the spinner, the spinner and the game board
rotate, as shown in Figure 17-10.


Figure 17-10. The spinner UI element now animates on-screen and also rotates when clicked to spin the game
board


Figure 17-9. Add rotSpinner.play() after rotGameBoard.play() in the mouse event handling construct so both
will animate

Free download pdf