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 16 ■ Collision Detection: Creating SVG Polygons for the Game Actors and Writing Code to Detect Collision<br />

Figure 16-33. Add a line of code under the .playiSound0() method call, and type invinciBagel.castDirector, and a<br />

period<br />

After you double-click on the .addToRemoveActors(Actor… actors) option in this pop-up helper dialog, you<br />

will need to pass the Actor object, aptly named object, into the method call using the parameter list area inside of the<br />

parentheses, as shown highlighted at the bottom of Figure 16-34. This will add this Actor object that was just involved<br />

in a collision (luckily, no one was hurt) to the REMOVED_ACTORS HashSet object.<br />

Figure 16-34. Add Actor object that was passed into the .collide() method to parameter list of addToRemovedActors()<br />

www.it-ebooks.info<br />

379

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

Saved successfully!

Ooh no, something went wrong!