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 />

Next click on the tracer icon at the top of the sprite editing area (it is the middle icon, that looks like a magic<br />

wand), which will open the Tracer dialog, shown in Figure 16-22. In this dialog you can set the zoom, tracing<br />

algorithm tolerance, Trace Mode and Frame mode, and see the resulting vertex count as a result of these settings.<br />

Figure 16-22. Using the Tracer utility in PhysEd to set the Tolerance, Trace mode, Frame mode and Vertices<br />

Once you have the visual result that you’re looking for, which is accomplished by tweaking the various Trace dialog<br />

settings, click on the OK button, and you will be taken back to the PhysicsEditor primary user interface window.<br />

You can then refine your collision polygon structure data point by data point, by clicking and dragging these<br />

points with your mouse, as seen in Figure 16-23. If you compare the collision polygon in Figure 16-22 with the one in<br />

Figure 16-23, you can see I that have refined several of the data points to better conform to the outline of the sprite.<br />

364<br />

www.it-ebooks.info

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

Saved successfully!

Ooh no, something went wrong!