Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1

Chapter 16 ■ 3D Game animation Creation: UsinG the animation transition Classes


After the next chapter, when we cover 3D Scene event handling as well as the PickResult class, we can
start to finish the animation of the spinner UI element so that it comes on the screen when needed and goes
off the screen when the user no longer needs to spin the game board.
I wanted to dedicate a chapter to Animation objects, show you how the precoded Transition
subclasses can provide you with Java 9 code to add animation to your game play, and show you how
to set up the majority of the Animation objects and their code. I also wanted to show you how put the
createAnimationAssets() method in place so that you can add Animation objects, which will have their
very own place to live in your pro Java 9 game development from this point onward.


Summary


In this sixteenth chapter, we learned about the Animation superclass and the Transition superclass, as well
as some of the important Transition subclasses, RotateTransition and TranslationTransition, that allow us
to move and rotate 3D objects during and for gameplay. We also looked at the ParallelTransition subclass,
which allows us to combine these Animation objects to create more complex Animation objects. We also
constructed the Animation objects for our game, which will allow the user to apply a random spin to the
game board to select a topic quadrant and to move a spinning spinner UI element on and off the screen,
when it is time to randomly spin the game board.
We created a new custom method for our JavaFXGame class called createAnimationAssets(), which
will hold all of the Animation objects created for the pro Java 9 game design using Transition subclasses
such as RotateTransition, TranslateTransition, ScaleTransition, and ParallelTransition.
In Chapter 17 , we’re going to learn about MouseEvent handling for the 3D Scene elements so that we
can click the Sphere 3D spinner UI to spin the game board and so we can eventually click each of the game
board squares in order to select the educational question categories and bring up the questions for the
player to answer.

Free download pdf