Game Development Reference
In-Depth Information
primaryStage.setTitle(InvinciBagel);
root = new StackPane();
scene = new Scene( root , WIDTH, HEIGHT, Color.WHITE);
primaryStage.setScene( scene );
primaryStage.show();
As you can see in Figure 11-1 , we are taking the root and scene object instanti-
ations out of the method that is called .createSplashScreenNodes(), and putting these at
the top of the .start() method. I am doing this because they are foundational to our In-
vinciBagel game (class). Next, we are also going to add six all-new method structures
to our existing code. The only method that will remain untouched during this process is
your .addNodesToStackPane() . You can see I'm calling the methods in a logical or-
der: add events, add images, add actors, add Scene Graph, and add cast.
Figure 11-1 . Place basic configuration statements at top of the .start() method, and then the eight game method calls
The method calls that we are going to put into place during the first part of this
chapter involve creating the event handlers for the Scene object, which we will do right
after we have set-up that Scene object named scene. The next thing that we will need to
do in the process of adding to the game is to load the Image object assets (digital image
references), which is what your .loadImageAssets() method will do. Once your Image
objects are declared and instantiated, we can then create the game actors using the .cre-
 
 
Search WWH ::




Custom Search