Game Development Reference
In-Depth Information
motion on the screen will make game play more interesting, and allow us to make the
game more challenging for the player.
Creating the Actor Engine up front will give you experience in creating public ab-
stract classes. As you recall from Chapter 3 , public abstract classes are used to create
other class (and object) structures in Java, but are not used directly in the actual game
programming logic. This is the reason I am terming creating these two “blueprint”
classes creating the Actor Engine, as we are essentially defining the lowest level of the
game, the “actors” during this chapter.
As we progress in the design of the game during the topic, we'll create the Treas-
ure subclass using the Actor (fixed sprite) class, for “fixed” treasures that will get
picked up by InvinciBagel during the game play. We'll also create the Prop class using
this Actor superclass, for the obstacles in the game that InvinciBagel has to navigate
up, over, under, around, or through, successfully. We'll also create sprites that move
around on the screen using the Hero subclass of the Actor superclass, such as the Bagel
class. We'll eventually create an Enemy class and Projectile class.
Besides designing the two key public abstract Actor classes during this chapter, we
will also define our main InvinciBagel character's digital image states using less than
ten PNG32 digital image assets. We will do this during this chapter so that this is in
place before we'll want to use these classes and sprite image states in the next chapter
of the topic, when we'll look at event handling, so that the player can control where the
InvinciBagel goes around the screen and what states (stand, run, jump, leap, fly, land,
miss, crouch, etc.) he is using to navigate the obstacles in his world.
Game Actor Design: Defining the Attrib-
utes Up Front
The foundation of any popular game is the characters - the Hero and his Arch Enemies
- as well as the game's obstacles, armory (projectiles), and treasures. Each of these
“actors” need to have attributes, defined using variables in Java, that keep track of what
is going on with each of these actors during game play in real time, using areas of sys-
tem memory. I am going to try to do this right the first time, in the same sense that you
want to define a database record structure to hold the data you will need out into the fu-
ture correctly the first time that you define your database. This can be a challenging
stage of your game development, as you need to look out into the future and ascertain
what features you want your game and its actors to have, and then put those into your
actor's capabilities (variables and methods) up front. Figure 8-1 gives you an idea of
 
Search WWH ::




Custom Search