function drawship(ctx, x, y, rot) {
ctx.lineWidth = 3;
ctx.save();
ctx.translate(x,y);
ctx.rotate(rot);
ctx.stroke(_shippath);
if (ctx != _ctx) ctx.restore();
}
function makeshippath() {
var path = new Path2D();
path.moveTo(20,0);
path.lineTo(-20,10);
path.lineTo(-16,7);
path.lineTo(-16,-7);
path.lineTo(-20,-10);
path.closePath();
return path;
}
var _ship = {
x : 0,
y : 0,
dx : 0,
dy : 0,
angle : 0,
da : 0,
invulnerable : 180,
reset : function() {
this.x = _width/2;
this.y = _height/2;
this.dx = this.dy = this.da = 0;
this.angle = 0;
this.da = 0;
this.invulnerable = 180;