Game Development Reference
In-Depth Information
CHAPTER 14
Setting Up the Game Environ-
ment: Creating Fixed Sprite
Classes Using the Actor Super-
class
Now that we made a significant amount of progress creating your primary InvinciBagel
character, using a number of key methods in the Bagel.java class, as well as the Actor
and Hero superclasses, all of which we put into place along with the GamePlayLoop
class and CastingDirector class in Chapters 7 through 13 , it is time to add fixed sprite
objects, which I will call “Props,” into the Scene and on the Stage (on the screen). These
fixed objects are almost as important to the game as the main character himself, as they
can be used to provide obstacles, barriers, protection from the enemy, and various chal-
lenges for the primary game hero character to overcome. We will also need these fixed
objects in the Scene to use in our collision detection program logic, and to test our Cast-
ingDirector class (object).
If you remember, back in Chapter 8 , we created the Actor superclass with fixed
sprites in mind and the Hero superclass with motion sprites in mind. I started out with
the motion sprites, because the primary game character is a motion sprite, and even
though motion sprites are more complex, by their very nature, they are also a lot more
fun to play around with! Now I need to take a chapter and put the Actor superclass into
action and create some Prop -related subclasses. We will use these Actor subclasses to
populate our Scene (Stage) with things such as platforms, obstacles, barriers, bridges,
treasure, and similar game play fixed location objects that you will want to add into the
Search WWH ::




Custom Search