Game Development Reference
In-Depth Information
Figure 17-23 . Instantiate Image and Projectile objects and add them to JavaFX Scene Graph and CastingDirector
object
While we are adding game design elements to the game, let's go ahead and learn
how to use a splashscreen ImageView Node object to implement a game background
image plate. We will do this so that our white iBeagle, and (Cream) iCheese and iBullet
objects, stand out to the game player better, using an enhanced blue background color.
Adding a Background Image: Using
.toBack() Method
Before we get into coding the collision and scoring routines for the Enemy and Pro-
jectile objects, let's add an Image asset (object) to use in the background plate, while
we are in the process of adding objects to our game. Copy the skycloud.png 8-bit
PNG8 image asset, seen in the bottom-left corner of Figure 17-24 , from the topic re-
pository into the NetBeansProjects/InvinciBagel/src folder. After you do this, add a
 
 
Search WWH ::




Custom Search