deep.js
// one for rotation about the fixed pivot point. Hard work!

one for rotation about the fixed pivot point. Hard work!
one for rotation about the fixed pivot point . Hard work!
function Draw_Turret_V(gx, gy, fDistCen, fLen, fWid, fNode, fRecoil, aRotation, aPivotRot, fInjury)
{
	fRecoil *= Zoom_Fctr;
	var sp = ptos(gx, gy);
	context.save();
	context.translate(sp.x, sp.y);
	context.rotate(aRotation * Math.PI / 180.0);
	context.translate(0, fDistCen);
	context.rotate(aPivotRot * Math.PI / 180.0);
	context.translate(0, -fDistCen);
	context.translate(0 - sp.x, 0 - sp.y);
	context.beginPath();
	context.fillStyle = Make_Color(_TF.r, _TF.g, _TF.b);
	context.fillRect(sp.x - fWid / 2, sp.y + fDistCen, fWid, fLen - fRecoil, fWid * 2);
	if (fInjury > 0)
	{
		context.fillStyle = Make_Color_Ex(255, 0, 0, fInjury);
		context.fillRect(sp.x - fWid / 2, sp.y + fDistCen, fWid, fLen - fRecoil, fWid * 2);
	}
	context.strokeStyle = Make_Color(_TB.r, _TB.g, _TB.b);
	context.lineWidth = 3.0 * Zoom_Fctr;
	context.lineJoin = "round";
	context.rect(sp.x - fWid / 2, sp.y + fDistCen, fWid, fLen - fRecoil, fWid * 2);
	context.stroke();
	if (fInjury > 0)
	{
		context.strokeStyle = Make_Color_Ex(255, 0, 0, fInjury);
		context.stroke();
	}
	context.closePath();
	context.beginPath();
	context.arc(sp.x, sp.y + fDistCen, fNode, 0, 2 * Math.PI, false);
	context.closePath();
	context.fill();
	context.stroke();
	context.restore();
}
function Draw_Turret_V ( gx , gy , fDistCen , fLen , fWid , fNode , fRecoil , aRotation , aPivotRot , fInjury ) { fRecoil *= Zoom_Fctr ; var sp = ptos ( gx , gy ) ; context . save ( ) ; context . translate ( sp . x , sp . y ) ; context . rotate ( aRotation * Math . PI / 180.0 ) ; context . translate ( 0 , fDistCen ) ; context . rotate ( aPivotRot * Math . PI / 180.0 ) ; context . translate ( 0 , - fDistCen ) ; context . translate ( 0 - sp . x , 0 - sp . y ) ; context . beginPath ( ) ; context . fillStyle = Make_Color ( _TF . r , _TF . g , _TF . b ) ; context . fillRect ( sp . x - fWid / 2 , sp . y + fDistCen , fWid , fLen - fRecoil , fWid * 2 ) ; if ( fInjury > 0 ) { context . fillStyle = Make_Color_Ex ( 255 , 0 , 0 , fInjury ) ; context . fillRect ( sp . x - fWid / 2 , sp . y + fDistCen , fWid , fLen - fRecoil , fWid * 2 ) ; } context . strokeStyle = Make_Color ( _TB . r , _TB . g , _TB . b ) ; context . lineWidth = 3.0 * Zoom_Fctr ; context . lineJoin = "round" ; context . rect ( sp . x - fWid / 2 , sp . y + fDistCen , fWid , fLen - fRecoil , fWid * 2 ) ; context . stroke ( ) ; if ( fInjury > 0 ) { context . strokeStyle = Make_Color_Ex ( 255 , 0 , 0 , fInjury ) ; context . stroke ( ) ; } context . closePath ( ) ; context . beginPath ( ) ; context . arc ( sp . x , sp . y + fDistCen , fNode , 0 , 2 * Math . PI , false ) ; context . closePath ( ) ; context . fill ( ) ; context . stroke ( ) ; context . restore ( ) ; }
one for rotation about the fixed pivot point.
one for rotation about the fixed pivot point .