Now, we are going to create specialized subclasses of
SpriteWrapper for each character in our game. As we have three different aliens in the game, we will create an
AlienWrapper class, to group the common behavior of the aliens, and then three subclasses to take full advantage of object-oriented capabilities.
abstract class—AlienWrapper(a subclass of
SpriteWrapper)—using the following declaration:
public abstract class AlienWrapper : SpriteWrapper
protectedvariables (the aliens have to rotate at a certain speed):
// The current rotation angle protected double _angle; // The rotation speed protected double _rotationSpeed; ...