Game Development Reference
In-Depth Information
Figure 14-19 . Use your file management software to copy the prop0 and prop1 PNG8 files into the project /src folder
Next, let's instantiate the Image object that holds one of the prop images, a tileable
brick, so that we can use our four InvinciBagel.java methods, .loadImageAssets() ,
.createGameActors() , .addGameActorNodes() , and, finally, .createCastingDirec-
tion() to install fixed Prop objects into our game's Scene object, and onto our game's
Stage object.
Instantiate Image Objects: Using the .loadImageAs-
sets() Method
Open the InvinciBagel.java tab in NetBeans and open the loadImageAssets() method.
Now add an iP0 Image object instantiation statement referencing the prop0.png file and
its 72x32 pixel size. The Java code to create the iP0 Image object, which you can see in
Figure 14-20 , should look like the following Java statement:
iP0 = new Image(" /prop0.png ", 72 , 32 , true, false, true);
 
 
Search WWH ::




Custom Search