Game Development Reference
In-Depth Information
veloped during this chapter. We will use the data set that has only 15 data points, so
that we can see all of our collision polygon data in our NetBeans 8.0 code editing pane.
As you can see in Figure 16-24 , we will need to put the Bagel() constructor method call
on three different lines: one for the iBagel = new Bagel(this) part of the in-
stantiation, another for the collision polygon SVG data String object , and another for
the xLocation, yLocation and Image object List. We will also be using our knowledge
of SVG commands, which we learned from Table 16-1 , to create the collision polygon
data for our tileable brick elements. We will be using these brick “Prop” elements to
develop our collision detection Java code later on in the chapter. We will create these
simpler collision polygons using only our brains, by implementing numeric logic that
relates to the resolution of the brick image, and where the corner pixel locations would
be in X,Y coordinate space, in conjunction with the SVG path drawing commands that
we learned about in Table 16-1 . You are becoming quite a game development profes-
sional!
Figure 16-24 . Copy and paste your 15 data point collision polygon SVG data in place of dummy data in Bagel()
method
We will also use the Java code commenting technique that we learned in Chapter 3
to remove (temporarily) the larger mossy rock props from the Scene, and get our code
to that place where we have the InvinciBagel character, and several bricks, on the
Stage. We can then use these basic objects to start our code development concerning
using the .collide() method and how it will use the castDirector CastingDirector class
(object) as a collision processing guide.
 
 
Search WWH ::




Custom Search