Game Development Reference
In-Depth Information
be loaded into system memory and will be used in our collision detection routines,
which we will be putting into place later in this chapter.
In this chapter we'll take a detailed look at how the SVG Path data can be defined.
This is specified by World Wide Web (W3) Consortium (also known as W3C), the
body who defines HTML5. This specification is on their w3.org website, and is located
at the http://www.w3.org/TR/SVG/paths.html URL, if you want to view it
in further detail.
After we look at the SVG or Scalable Vector Graphics (in case you are wondering
what this stands for) data format in detail, we will get into using the popular GIMP 2.8
digital image editing software, which you installed in Chapter 1 , and learn how to cre-
ate collision polygons. We will also take a look at how to use the PhysEd (PhysicsEdit-
or) collision polygon generation software. This is from a company called
CodeAndWeb GmbH, who makes professional, and affordable, game assets creation
software.
We will go through a collision polygon vector asset creation and optimization pro-
cess using GIMP 2.8, using both the quick and dirty work process, which allows GIMP
to 100% create the collision polygon shape for you, as well as a more “involved” work
process, where you create your own collision polygon yourself, by hand, using GIMP's
Path tools. After we have learned how to create collision polygons that are compatible
with the JavaFX SVGPath class, we will spend the remainder of the chapter on Java 8
game programming, creating the collision detection engine (code) that will allow us to
detect when our InvinciBagel character comes into contact with any of the other Actor
objects in the game environment (Scene and Stage objects). This is where the topic will
start to become more advanced (useful).
The SVG Data Format: Hand Coding
Vector Shapes
There are ten different letters that can be utilized with the numeric (X,Y data point loc-
ation in 2D space) data in an SVG data string. Each has an upper case (absolute refer-
encing) and a lower case (relative referencing) version. We will be using absolute refer-
encing as we need these data points to match up with pixel locations in the sprite im-
agery that we are going to “attach” or group these SVG Path data strings with to
provide collision detection data guidelines. As you can see in Table 16-1 , the SVG data
commands provide you a great deal of flexibility in defining custom curves for your
Java 8 game development. You could even combine all of these scalable vector com-
 
Search WWH ::




Custom Search