Game Development Reference
In-Depth Information
particles = [];
for (var particleCtr:int=0;particleCtr<maxParticles;particleCtr++) {
var tempParticle:BasicBiltArrayParticle = new BasicBiltArrayParticle
(0,799,0,799);
particlePool.push(tempParticle);
}
}
public function createLevelParticles(spriteGlowFilter:GlowFilter,
levelColor:uint):void {
var tempBlitArrayAsset:BlitArrayAsset = new BlitArrayAsset();
particleBitmapData = new BitmapData(8, 8, true, 0x00000000);
drawingCanvas.graphics.clear();
drawingCanvas.graphics.lineStyle(1, 0xffffff);
drawingCanvas.graphics.drawRect(3, 3, 2, 2);
particleBitmapData.draw(drawingCanvas);
spriteGlowFilter.color = levelColor;
particleBitmapData.applyFilter(particleBitmapData, particleBitmapData.rect,
point0, spriteGlowFilter);
tempBlitArrayAsset= new BlitArrayAsset();
tempBlitArrayAsset.createFadeOutBlitArrayFromBD(particleBitmapData, 30);
particleAnimationFrames = tempBlitArrayAsset.tileList;
}
}
}
Designing the ProjectileManager class
The structure of the ProjectileManager class is almost identical to that of the ParticalManager
class. The major difference is that the projectilePool is only created a single time per game
session unlike the particle pool, which is recreated every level. The projectiles will be instances
of the BasicBlitArrayProjectile class.
The location for this package is com.efg.games.blastermines .
The public attributes for this class are
public var projectileBitmapData:BitmapData : This is the BitmapData look for the
Projectiles .
public var projectileAnimationFrames : Projectile s rotate as they fly through the air.
The rotation animation frames will be stored in this array. It will be created with the
BlitArrayAsset class.
public var projectiles:Array : This attribute contains an array of the current active
Projectile s.
Search WWH ::




Custom Search