Game Development Reference
In-Depth Information
As you can see in Figure 14-16 , the code is error-free, and you now have a PropB
class, which will create fixed objects for your Scene that are flipped or mirrored around
both the X and the Y axis at the same time! Having these four different fixed Prop
classes will allow us to quickly and easily design Scene (and eventually, game levels)
elements, without having to do anything but declare the correct prop class, and referen-
ce the correct Image asset and X,Y locus (location) and collision polygon SVG data.
Figure 14-16 . A completed PropB() constructor method creates a fixed PropB object flipped along both the X and Y
axis
Now we are ready to use these four new fixed sprite classes, and learn how to add
Scene (Stage) elements.
Using the Prop Class: Creating Fixed
Scene Objects
Before we get into the coding in our InvinciBagel.java class, which you should have
open in its own tab in NetBeans already, and use these Prop classes to add fixed sprite
design elements to our game, I wanted to show you how to get rid of those pesky little
wrench icons next to your file names. You may have several of these on your IDE
 
Search WWH ::




Custom Search