Game Development Reference
In-Depth Information
Let's use the exact same work process, and add a
PropV
object into the scene, so
that we can see how this tile image can be flipped and mirrored around the X axis, to
create even more complex seamless tileable constructs for your Java 8 game develop-
ment. Let's use the same naming convention, and name this new PropV object
iPV0
.
Your new Java instantiation statement, which can be seen in
Figure 14-24
, should look
like the following line of Java code:
iPV0
=
new PropV
("M150 0 L75 200 L225 200 Z", 0, 0,
iP0
);
The next logical step to adding a fixed sprite prop, is to add the ImageView
Node
object for this iPV0 PropV object into the Scene Graph
root
StackPane object. This is
accomplished using the
.getChildren().add()
method chain, which references the
spriteFrame
ImageView object, which lives inside of the
iPV0
PropV object, using
dot notation. This can be accomplished by using the following Java programming state-
ment, which is also shown in
Figure 14-24
:
root
.getChildren().add(
iPV0.spriteFrame
);
Finally, we will use the
.addCurrentCast()
method, that we created in
Chapter 10
,
to add this
iPV0
object to the CURRENT_CAST List<Actor> ArrayList object, inside
of the castDirector CastingDirector object, using the following line of Java code, which
is also shown at the very bottom of
Figure 14-24
:
castDirector
.addCurrentCast(
iPV0
);