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 14 ■ Setting Up the Game Environment: Creating Fixed Sprite Classes Using the Actor Superclass<br />

The <strong>Java</strong> code still has a wavy red error highlight under the class declaration statement, seen in Figure 14-5.<br />

Figure 14-5. Overriding .update() method doesn’t remove the error, so mouse-over again, to reveal needed constructor<br />

Mouse-over this and you’ll see you need to code a Prop() constructor method using the following <strong>Java</strong> code:<br />

public Prop(String SVGdata, double xLocation, double yLocation, Image... spriteCels) {method code}<br />

To remove the error seen in Figure 14-6, use Alt-Enter, selecting Add import for javafx.scene.image.Image.<br />

Figure 14-6. Add a public Prop() constructor, and mouse-over the error highlight, and select Add import for Image class<br />

302<br />

www.it-ebooks.info<br />

c

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

Saved successfully!

Ooh no, something went wrong!