function Renderer(options) {
  this.canvas = options.canvas;
  this.context = options.context;
};

function drawFuselage(context,plane) {
  context.fillRect(plane.x, plane.y, plane.width, plane.height);
}

function drawWings(xMid,context,plane) {
  context.beginPath();
  context.moveTo(xMid - (plane.wingspan/2), plane.y + 13);
  context.lineTo(xMid, plane.y + 5);
  context.lineTo(xMid + (plane.wingspan/2), plane.y + 13);
  context.fill();
}

function drawComputerWings(xMid,context,plane) {
  context.moveTo(xMid - (plane.wingspan/2), plane.y + 13);
  context.lineTo(xMid, plane.y + 21);
  context.lineTo(xMid + (plane.wingspan/2), plane.y + 13);
  context.fill();
}


function drawNose(xMid,context,plane) {
  context.moveTo(plane.x, plane.y);
  context.lineTo(xMid, plane.y - 5);
  context.lineTo(plane.x + plane.width, plane.y);
  context.fill();
}

function drawComputerNose(xMid,context,plane) {
  context.moveTo(plane.x, plane.y + plane.height);
  context.lineTo(xMid, plane.y + plane.height + 5);
  context.lineTo(plane.x + plane.width, plane.y + plane.height);
  context.fill();
}

function drawComputerFuselageTail(xMid,context,plane) {
  context.moveTo(plane.x, plane.y + plane.height);
  context.lineTo(xMid, plane.y + plane.height + 5);
  context.lineTo(plane.x + plane.width, plane.y + plane.height);
  context.fill();
}

function drawTail(xMid,context,plane) {
  context.moveTo(xMid - (plane.tailspan/2), plane.y + 32);
  context.lineTo(xMid, plane.y + 25);
  context.lineTo(xMid + (plane.tailspan/2), plane.y + 32);
  context.fill();
}

function drawComputerTail(xMid,context,plane) {
  context.moveTo(xMid - (plane.tailspan/2), plane.y - 7);
  context.lineTo(xMid, plane.y);
  context.lineTo(xMid + (plane.tailspan/2), plane.y - 7);
  context.fill();
}


Renderer.prototype.drawPlanes = function(planes) {
  var context = this.context
  planes.forEach(function(plane){
    context.fillStyle = "red";
    var xMid = plane.x + (plane.width/2);
    context.beginPath();
    drawFuselage(context,plane)
    if (plane.type === "player") {
      drawWings(xMid,context,plane)
      drawNose(xMid,context,plane)
      drawComputerNose(xMid,context,plane)
      drawTail(xMid,context,plane)
    } else if (plane.type === "computer") {
      drawComputerWings(xMid,context,plane)
      drawComputerNose(xMid,context,plane)
      drawNose(xMid,context,plane)
      drawComputerTail(xMid,context,plane)
    }
  })
};

module.exports = Renderer;

@@ -208,24 +208,30 @@
 unction draw
+Player
 Wings(xMid,c
@@ -671,17 +671,16 @@
 l();%0A%7D%0A%0A
-%0A
 function
@@ -682,25 +682,34 @@
 ction drawNo
-s
+rthTriangl
 e(xMid,conte
@@ -873,35 +873,36 @@
 unction draw
-ComputerNos
+SouthTriangl
 e(xMid,conte
@@ -1119,253 +1119,14 @@
 draw
-ComputerFuselageTail(xMid,context,plane) %7B%0A  context.moveTo(plane.x, plane.y + plane.height);%0A  context.lineTo(xMid, plane.y + plane.height + 5);%0A  context.lineTo(plane.x + plane.width, plane.y + plane.height);%0A  context.fill();%0A%7D%0A%0Afunction draw
+Player
 Tail
@@ -1543,17 +1543,16 @@
 l();%0A%7D%0A%0A
-%0A
 Renderer
@@ -1795,54 +1795,67 @@
     
-if (plane.type === %22player%22) %7B
+drawNorthTriangle(xMid,context,plane)
 %0A    
-  
 draw
-Wings
+SouthTriangle
 (xMi
@@ -1875,65 +1875,65 @@
 ne)%0A
+%0A
     
-  drawNose(xMid,context,plane)%0A      drawComputerNose
+if (plane.type === %22player%22) %7B%0A      drawPlayerWings
 (xMi
@@ -1959,16 +1959,22 @@
     draw
+Player
 Tail(xMi
@@ -2082,86 +2082,8 @@
 ne)%0A
-      drawComputerNose(xMid,context,plane)%0A      drawNose(xMid,context,plane)%0A
     

Refactor names in renderer class