Game Development Reference
In-Depth Information
if (degrees < 0) {
frame = 359+degrees;
}
bitmapData=animationList[frame]
}
public function createPlayerShip(spriteGlowFilter:GlowFilter):void {
var tempBlitArrayAsset:BlitArrayAsset = new BlitArrayAsset();
drawingCanvas.graphics.clear();
drawingCanvas.graphics.lineStyle(1, 0xffffff);
drawingCanvas.graphics.moveTo(15, 7);
drawingCanvas.graphics.lineTo(7, 24);
drawingCanvas.graphics.lineTo(15, 19);
drawingCanvas.graphics.moveTo(16, 19);
drawingCanvas.graphics.lineTo(24, 24);
drawingCanvas.graphics.lineTo(16, 7);
trace("drawingCanvas.height=" + drawingCanvas.height);
trace("drawingCanvas.width=" + drawingCanvas.width);
shipBitmapData.draw(drawingCanvas);
shipBitmapData.applyFilter(shipBitmapData, shipBitmapData.rect, new Point(0,0),
spriteGlowFilter);
animationList=tempBlitArrayAsset.createRotationBlitArrayFromBD
(shipBitmapData, 1,90);
//*** end player ship
//*** shield
drawingCanvas.graphics.clear();
drawingCanvas.graphics.lineStyle(3, 0xffffff);
drawingCanvas.graphics.drawCircle(15, 15, 14);
shieldBitmapData.draw(drawingCanvas);
//*** end shield
}
}
}
As we progress through this game code, we will discuss this class in even more detail. Next up,
we will create three manager classes for our game that will encapsulate functionality for groups of
objects. The first is the MineManager class. This class will manage the Mine enemy ships that the
player must destroy.
As these classes are core to the Blaster Mines game, they will be discussed in detail when we go
though the game code. For now, let's briefly look at the code for each and a short description of
the public and private attributes and function that each contains.
Search WWH ::




Custom Search