Game Development Reference
In-Depth Information
Figure 14-22 . Testing InvinciBagel 0,0 prop placement (left) and changing the z-index in .addGameActorNodes()
(right)
As you can see, the InvinciBagel character is behind the Prop object, which means
that we need to change the order of the Java statements inside of the .addGameActor-
Nodes() method, since the order that Node objects are added to the Scene Graph de-
termines their z-index or z-order . As you can see in Figure 14-23 , I have moved the
.add() method call to add iPR0 above the one for iBagel, so as you can see on the right
side of Figure 14-22 , the InvinciBagel character is now on top of the Prop object. Once
we add collision detection this will not be an issue, of course. Let's use the same work
process and add a PropH object into the scene, so that I can show you how this tile im-
age can be flipped and mirrored to create seamless tileable constructs for your Java 8
game development.
Let's use the same naming convention and name the PropH object iPH0. The Java
instantiation statement, which can be seen in Figure 14-23 , should look like the follow-
ing line of Java code:
iPH0 = new PropH ("M150 0 L75 200 L225 200 Z", 0, 0, iP0 );
 
 
Search WWH ::




Custom Search