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

Figure 16-9. Insert 15 strategically placed points to define a collision shape and use the Export Path to export SVG data<br />

Export your hand-drawn path, by selecting, and right-clicking on the Unnamed Path shown in the middle of<br />

Figure 16-9, and use the Export Path menu option to export it as the file sprite1svghand.svg, just like you did back in<br />

Figure 16-5. If you want to name the path in GIMP, you can double-click on the path name in the path dialog, and give<br />

it a name, if you like. If you want to save your work in the native GIMP .xcf file format, you can also use the File ➤ Save<br />

menu sequence, and give the file a name, such as sprite1svgpath15points.xcf.<br />

Next, use your Text Editor’s (Notepad, for instance) File Open dialog, as was shown in Figure 16-6, and open the<br />

latest sprite1svghand.svg file, so you can see how much data you have saved relative to the nearly 100 data point pairs<br />

that the GIMP Fuzzy Select Tool selection work process provided for us in the first section of this chapter.<br />

As you can see in Figure 16-10, there are 14 times 3 (42) data pairs, which is less than half of the amount that we<br />

had in the previous work process. This is strange, because theoretically, there should only be 15 data pairs, so let’s do<br />

some investigative work, and see what might be going on with this data.<br />

354<br />

www.it-ebooks.info

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

Saved successfully!

Ooh no, something went wrong!