module.exports = Laser;

function Laser (ship,context) {
  this.x = ship.x;
  this.y = ship.y;
  this.angle = ship.angle;
  this.laserSpeed = 10;
  this.context = context;

  return this;
}

Laser.prototype.setLaserTrajectory = function () {
  if(this.angle === 0) {
        this.y -= this.laserSpeed;
    }
    else if(this.angle === 45) {
        this.y -= this.laserSpeed;
        this.x += this.laserSpeed;
    }
    else if(this.angle === 90) {
        this.x += this.laserSpeed;
    }
    else if(this.angle === 135) {
        this.y += this.laserSpeed;
        this.x += this.laserSpeed;
    }
    else if(this.angle === 180) {
        this.y += this.laserSpeed;
    }
    else if(this.angle === 225) {
        this.y += this.laserSpeed;
        this.x -= this.laserSpeed;
    }
    else if(this.angle === 270) {
        this.x -= this.laserSpeed;
    }
    else if(this.angle === 315) {
        this.y -= this.laserSpeed;
        this.x -= this.laserSpeed;
    }

    return this;
}

Laser.prototype.draw = function () {
  this.context.strokeStyle = '#f00';
  this.context.moveTo(this.x, this.y);
  this.setLaserTrajectory();
  this.context.lineTo(this.x, this.y);
  this.context.stroke();

  return this;
}
@@ -46,24 +46,90 @@
 ,context) %7B%0A
+    this.ship = ship;%0A    this.shipheight = this.ship.height/3;%0A  
   this.x = s
@@ -135,16 +135,18 @@
 ship.x;%0A
+  
   this.y
@@ -156,16 +156,18 @@
 ship.y;%0A
+  
   this.a
@@ -183,24 +183,26 @@
 ip.angle;%0A  
+ 
+ 
 this.laserSp
@@ -211,16 +211,44 @@
 d = 10;%0A
+    this.laserLength = 1;%0A  
   this.c
@@ -266,16 +266,18 @@
 ntext;%0A%0A
+  
   return
@@ -337,16 +337,18 @@
 on () %7B%0A
+  
   if(thi
@@ -1126,16 +1126,18 @@
 on () %7B%0A
+  
   this.c
@@ -1147,22 +1147,20 @@
 ext.
-stroke
+fill
 Style = 
 '#f0
@@ -1159,16 +1159,17 @@
 e = 
-'
+%22
 #f00
-';%0A
+%22%0A  
   th
@@ -1183,14 +1183,41 @@
 ext.
-moveTo
+beginPath();%0A    this.context.arc
 (thi
@@ -1231,42 +1231,56 @@
 is.y
-);%0A  
+-
 this.s
-etLaserTrajectory(
+hipheight, 1.5, 0, Math.PI*2, true
 );%0A  
+ 
+ 
 this
@@ -1292,32 +1292,23 @@
 ext.
-lineTo(this.x, this.y
+closePath(
 );%0A
+  
   th
@@ -1322,19 +1322,51 @@
 ext.
-stroke
+fill();%0A%0A    this.setLaserTrajectory
 ();%0A%0A
+  
   re

Fix bug where ship get's outlined with stroke when laser fires