Game Development Reference
In-Depth Information
}
bitmapData = animationList[frame];
}
public function render(canvasBitmapData:BitmapData):void {
x = nextX;
y = nextY;
point.x = x;
point.y = y;
canvasBitmapData.copyPixels(bitmapData, bitmapData.rect, point);
}
public function dispose():void {
bitmapData.dispose();
bitmapData = null;
animationList = null;
point = null;
}
}
}
The next two classes,
BasicBlitArrayParticle
and Basic
BlitArrayProjectile
, will be
subclasses of the
BasicBlitArrayObject
class. They are generic enough to be part of the
framework rather than the Blaster Mines page package.
Designing the BasicBlitArrayParticle class
The
BasicBlitArrayParticle
class is a subclass of the
BlitArrayObjec
t that will be used in our
game for basic explosion particles. This class will be added to the framework package and will be
located here:
com.efg.famework
.
Here are its public attributes:
public var lifeDelayCount:int
: The count of frames between changes in animation
public var lifeDelay:int
: The number of fames to count in
lifeDelayCount
Here is the private attribute:
private var remove:Boolean
:
remove
will be set to
true
if the particle needs to be
removed from the screen.
And these are the public functions:
public function BasicBiltArrayParticle(xMin:int,xMax:int, yMin:int, yMax:int
)
: The constructor for all of the children of
BasicBlitArrayObject
accepts in the same
parameters as their parent and pass them off with a call to
super(): super(xMin, xMax,
yMin, yMax);
.