Game Development Reference
In-Depth Information
the Button control focus (the blue outline) moves as well, which means that we will
also have to fix this in a future chapter, by having our KeyEvents “consumed.” As you
can see, there is lots of really cool code to write and things about Java 8 and JavaFX
8.0 to learn before we're finished!
Figure 11-17 . Notice the InvinciBagel character is using a lower Z-index than the UI elements, and can move off-
screen
Yet again you have made a ton of progress during this chapter in getting your
primary InvinciBagel.java class optimized, implementing all of the classes that you
have coded thus far in this topic, wired the game play loop engine into your primary
game character, tested all of your ActionEvent and KeyEvent handling, and had an all-
around good time doing it! I would call that a pretty successful chapter, and we will
continue to have a good time in every chapter!
Summary
In this eleventh chapter, we reorganized our primary InvinciBagel.java class to extract
the five key game creation Java statements, and then organized the rest of the Java code
into eight logical methods (routines), six of them which we created from scratch during
this chapter. The six new methods serve to parcelize things such as adding Image as-
sets, creating new Actor objects, adding Actors to the Scene Graph, adding Actors to
the Cast, creating and starting the Game Engine, and implementing the game key event
handling routines. We added object declarations so that we could create a new iBagel
Bagel object for our game's primary character, and also created a castDirector Cast-
ingDirection engine so that we could manage our cast members as we add them to the
game in later chapters.
 
Search WWH ::




Custom Search