28.04.2019 Views

[JAVA][Beginning Java 8 Games Development]

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 14 ■ Setting Up the Game Environment: Creating Fixed Sprite Classes Using the Actor Superclass<br />

Copy your iPR0 object instantiation and addition code, and create an iPR1 object, as shown in Figure 14-29.<br />

Figure 14-29. Instantiate an iPR1 Prop object, add it to the root Scene Graph, and add it to the CurrentCast List<br />

To put a moss rock at the top of the screen, I used the 0,-150 screen coordinates in my constructor method call.<br />

Now use the Run ➤ Project work process to take a look at the results, which are shown on the left in Figure 14-30.<br />

Figure 14-30. Run the project; the Prop iPR1 is shown at the left, and iPV1 PropV mirrored object is shown at the right<br />

www.it-ebooks.info<br />

319

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!