Game Development Reference
In-Depth Information
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 had in the previous work process. This is strange, be-
cause theoretically, there should only be 15 data pairs, so let's do some investigative
work, and see what might be going on with this data.
Figure 16-10 . Open SVG Path data in a text editor and add a Z “close polygon” command to the end of the data
Just as NetBeans 8 does not always utilize the “optimal” or correct work process to
suit our particular Java 8 game creation goals, it is possible that we are having the same
type of problem with GIMP. If this is the case here, we will have to take matters into
our own hands, and intervene by adding our own custom work process steps to achieve
the precise results that we know that we need for our Java 8 game development. Luck-
ily this SVG Path data uses text data, inside of an XML “container,” so we should be
able to add our own steps into this work process if we need to. In the end, you will find
that developing a professional Java 8 game is not as easy an endeavor as playing the
game itself!
Upon closer examination of the SVG data (the part after d=), the first thing that you
will see is that the level of numeric precision that is being utilized is not necessary for
this application. Since we are trying to match collision data point precision to pixel pre-
cision, we can use integer numbers, rather than the floating point numbers that are be-
ing utilized for this SVG data. Let's take matters into our own hands and round the
decimal portion of these floating point numbers up or down to the nearest whole in-
teger number . Doing this will get rid of the floating point precision that is currently
being utilized. This will be our second round of optimization (the first being hand
drawing a polygon). Also, add a “Z” close path command at the very end of the data, as
shown in Figure 16-10 , to form a closed polygon.
 
 
Search WWH ::




Custom Search