Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1

Chapter 21 ■ Questions and answers: Finishing the setup Methods and digital audio


To get some practice with what we covered in this chapter, create the other 19 setupQSgameplay()
method calls with the questions for each topic as well as the cameraAudio.play() calls that trigger your
camera zoom in audio.


Summary


In this twenty-first chapter, we learned how to create the answer selections for each game board square.
We also created a StackPane and Button objects for the player to use to record their answer. You will need
to create the other Java code to answer each game board square random options and enter this code to
complete the gameplay so that you can proceed to the next chapter, where we will be creating the scoring
engine, scoreboard, and high-score code that will track this portion of the game.
We also learned how to add digital audio assets to a game using the JavaFX AudioClip sequencer,
which has all of the core music synthesis and sound tracking and triggering tools that a synthesizer
possesses. We created both a timed digital audio clip and a looping (played until stopped) version of digital
audio so that you understand how to add digital audio assets for aural feedback for your players during their
gameplay experience.
In Chapter 22 , you’re going to develop a scoring engine code infrastructure, which will handle what
happens when the player selects the proper game square content answer. This means we will again be
developing 2D game elements to hold the scoreboard content, which will pop up and overlay more of the
unused portions of the 3D game user interface. In this case, this will be the bottom-right portions of the
gameplay screen.


Figure 21-40. To trigger a cameraAudio AudioClip, add a cameraAudio.play() method call to the
OnMouseClicked event handler

Free download pdf