deep.js
// This function draws a bullet in game coordinates.

This function draws a bullet in game coordinates.
This function draws a bullet in game coordinates .
function Draw_Bullet(gx, gy, size, rot, team, bullet)
{
	rot = (rot + 90) * Math.PI / 180;
	var sp = ptos(gx, gy);
	context.save();
	context.fillStyle = Make_Color(_C[team].r, _C[team].g, _C[team].b);
	context.strokeStyle = Make_Color(_O[team].r, _O[team].g, _O[team].b);
	context.lineWidth = 3.0 * Zoom_Fctr;
	context.lineJoin = "round";
	if (bullet == B_NORMAL)
	{
		context.beginPath();
		context.arc(sp.x, sp.y, size * Zoom_Fctr, 0, 2 * Math.PI, true);		
		context.fill();	
		context.stroke();
		context.closePath();
	}
	else if (bullet == B_BATTLESHIP || bullet == B_OVERLORD)
	{
		var sa_ = 2 * Math.PI / 3;
		size *= Zoom_Fctr;
		context.translate(sp.x, sp.y);
		context.beginPath();
		context.moveTo(size * Math.cos(0 + rot), size * Math.sin(0 + rot));
		for (var i = 1; i <= 3; i++) {
			context.lineTo(size * Math.cos(i * sa_ + rot), size * Math.sin(i * sa_ + rot));
		}
		context.closePath();
		context.fill();
		context.stroke();
	}
	else if (bullet == B_NECROMANCER)
	{
		var sa_ = 2 * Math.PI / 4;
		size *= Zoom_Fctr;
		context.translate(sp.x, sp.y);
		context.beginPath();
		context.moveTo(size * Math.cos(0 + rot), size * Math.sin(0 + rot));
		for (var i = 1; i <= 4; i++) {
			context.lineTo(size * Math.cos(i * sa_ + rot), size * Math.sin(i * sa_ + rot));
		}
		context.closePath();
		context.fill();
		context.stroke();
	}
	else if (bullet == B_TRAP)
	{
		var sa_ = 2 * Math.PI / 6;
		size *= Zoom_Fctr;
		context.translate(sp.x, sp.y);
		context.beginPath();
		context.moveTo(size * Math.cos(0 + rot), size * Math.sin(0 + rot));
		for (var i = 1; i <= 6; i++) {
			if (i % 2 == 0)
			{
				context.lineTo(size * Math.cos(i * sa_ + rot), size * Math.sin(i * sa_ + rot));
			}
			else
			{
				context.lineTo(size * 0.35 * Math.cos(i * sa_ + rot), size * 0.35 * Math.sin(i * sa_ + rot));
			}
		}
		context.closePath();
		context.fill();
		context.stroke();
	}
	else
	{
	}
	context.restore();
}
function Draw_Bullet ( gx , gy , size , rot , team , bullet ) { rot = ( rot + 90 ) * Math . PI / 180 ; var sp = ptos ( gx , gy ) ; context . save ( ) ; context . fillStyle = Make_Color ( _C [ team ] . r , _C [ team ] . g , _C [ team ] . b ) ; context . strokeStyle = Make_Color ( _O [ team ] . r , _O [ team ] . g , _O [ team ] . b ) ; context . lineWidth = 3.0 * Zoom_Fctr ; context . lineJoin = "round" ; if ( bullet == B_NORMAL ) { context . beginPath ( ) ; context . arc ( sp . x , sp . y , size * Zoom_Fctr , 0 , 2 * Math . PI , true ) ; context . fill ( ) ; context . stroke ( ) ; context . closePath ( ) ; } else if ( bullet == B_BATTLESHIP || bullet == B_OVERLORD ) { var sa_ = 2 * Math . PI / 3 ; size *= Zoom_Fctr ; context . translate ( sp . x , sp . y ) ; context . beginPath ( ) ; context . moveTo ( size * Math . cos ( 0 + rot ) , size * Math . sin ( 0 + rot ) ) ; for ( var i = 1 ; i <= 3 ; i ++ ) { context . lineTo ( size * Math . cos ( i * sa_ + rot ) , size * Math . sin ( i * sa_ + rot ) ) ; } context . closePath ( ) ; context . fill ( ) ; context . stroke ( ) ; } else if ( bullet == B_NECROMANCER ) { var sa_ = 2 * Math . PI / 4 ; size *= Zoom_Fctr ; context . translate ( sp . x , sp . y ) ; context . beginPath ( ) ; context . moveTo ( size * Math . cos ( 0 + rot ) , size * Math . sin ( 0 + rot ) ) ; for ( var i = 1 ; i <= 4 ; i ++ ) { context . lineTo ( size * Math . cos ( i * sa_ + rot ) , size * Math . sin ( i * sa_ + rot ) ) ; } context . closePath ( ) ; context . fill ( ) ; context . stroke ( ) ; } else if ( bullet == B_TRAP ) { var sa_ = 2 * Math . PI / 6 ; size *= Zoom_Fctr ; context . translate ( sp . x , sp . y ) ; context . beginPath ( ) ; context . moveTo ( size * Math . cos ( 0 + rot ) , size * Math . sin ( 0 + rot ) ) ; for ( var i = 1 ; i <= 6 ; i ++ ) { if ( i % 2 == 0 ) { context . lineTo ( size * Math . cos ( i * sa_ + rot ) , size * Math . sin ( i * sa_ + rot ) ) ; } else { context . lineTo ( size * 0.35 * Math . cos ( i * sa_ + rot ) , size * 0.35 * Math . sin ( i * sa_ + rot ) ) ; } } context . closePath ( ) ; context . fill ( ) ; context . stroke ( ) ; } else { } context . restore ( ) ; }
This function draws a bullet in game coordinates.
This function draws a bullet in game coordinates .
// TODO!
