Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1
Chapter 19 ■ Game Content enGine: ai LoGiC with random Content SeLeCtion methodS

Your OnFinished() event handling conditional if() Java code, after these modifications, should look just
like the following code block, which is also highlighted in yellow and light blue at the bottom of Figure 19-13:


rotGameBoard.setOnFinished( event-> {
if (quadrantLanding == 315 ) { populateQuadrantOne(); }
if (quadrantLanding == 225 ) { populateQuadrantTwo(); }
if (quadrantLanding == 135 ) { populateQuadrantThree(); }
if (quadrantLanding == 45 ) { populateQuadrantFour(); }
});


Figure 19-13. Reorder the angle offset if() statements so that they evaluate to the reverse direction of the game
board spin

Free download pdf