28.04.2019 Views

[JAVA][Beginning Java 8 Games Development]

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 17 ■ Enhancing Game Play: Creating a Scoring Engine, Adding Treasure and an Enemy Auto-Attack Engine<br />

Figure 17-25. Use a splashScreenBackplate.setImage() method call to install a skyCloud Image object in gameButton<br />

Since you have added this code to the gameButton’s event handling code, you must “counter” this move, by<br />

adding the same method call to the other three Button event handlers to set the image asset back to the splashscreen<br />

image asset, using the following <strong>Java</strong> code, shown in the other three Button event handling methods in Figure 17-25:<br />

splashScreenBackground.setImage(splashScreen);<br />

Use Run ➤ Project to test the code. As you can see on the left side of Figure 17-26, we have a z-index issue!<br />

414<br />

www.it-ebooks.info

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

Saved successfully!

Ooh no, something went wrong!