Game Development Reference
In-Depth Information
object, inside of the castDirector CastingDirector object, which can be seen at the bot-
tom of Figure 14-25 , and which uses this following single line of Java code:
castDirector .addCurrentCast( iPB0 );
Now that we've put all four of the Actor subclasses that we have created during the
first half of this chapter into service, we can test the application and see what the differ-
ent X and Y axis mirroring does to the prop0.png brick.
Use Run Project and test the game to see how each brick is mirrored differ-
ently, as shown in Figure 14-26 .
Figure 14-26 . Run
Project; Prop, PropH, and PropV shown at the left, and all four Prop subclasses shown at
the right
Next, let's take a look at how to use large Scene Prop objects to composite back-
ground elements on a Stage.
Using Larger Scene Props: Compositing
with JavaFX
One thing that is really nice about these four Prop Actor subclasses that we have cre-
ated is that they allow us to leverage the PNG8 (background image assets) and PNG32
(true color compositing images with alpha channels) image assets to do digital image
compositing right in our game Scene and Stage objects. If we do not use a fixed prop
with a motion sprite game character by implementing collision detection, and if we
keep these fix props in the background, by watching what we're doing inside of our
 
Search WWH ::




Custom Search