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-8. Open sprite1.png, select the Paths Tool, and start to draw a simple Path<br />

As you can see in Figure 16-9, I created the collision polygon using only 15 points. You can leave the polygon<br />

open, and simply add the Z character you learned about in the first section of the book, to create a closed polygon. As<br />

you can see on the right side of Figure 16-9, the polygon conforms closely to the sprite, so during game play the result<br />

of a collision will look like it happened with the pixels of your sprite rather than with the collision polygon, which even<br />

though the collision polygon path data is visible here in GIMP, will be invisible during your game play.<br />

353

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

Saved successfully!

Ooh no, something went wrong!