Game Development Reference
In-Depth Information
Figure 14-20 . Add the iP0 Image object instantiation using the prop0.png file name and the 72 by 32 pixel image size
Now we're ready to add our first Prop object to our game to add a fixed sprite,
which will allow us to create our game design using classes that we're putting into
place in our invincibagel package code base during this chapter.
Adding Fixed Sprites Using Prop Objects: .ad-
dGameActors()
After your .loadImageAssets() method there are three other method “containers” that
we designed for our use during the game design process, for adding Actor objects into
this game. These are called in the order that we need to utilize them for this process, so
let's continue to be organized, and use them in that order. The first instantiation that we
will need to perform creates a new (using the Java new keyword) Prop object. We will
use our “dummy” SVG shape data again for now, as well as the 0,0 center of the screen
X and Y locations, and finally, the iP0 Image asset, which we just declared and instan-
tiated during the previous sections of this chapter. The Java instantiation statement,
which can be seen in Figure 14-21 , should look like the following line of Java code:
iPR0 = new Prop("M150 0 L75 200 L225 200 Z", 0, 0, iP0 );
 
 
Search WWH ::




Custom Search