Function Parameters Midpoint

Be sure to change the title and author of this fiddle to match the assignment requirements!

by Prathameshsb

HTML

<div id="drawing"></div>

JavaScript

"use strict"
let draw = SVG('drawing');
draw.size(300, 300);

/* Draw the base */
function drawBase() {
  let base = draw.rect(200, 200);
  base.fill("white");
  base.stroke("black");
  base.move(basex, basey);
}
let basex = 50;
let basey = 100;
drawBase();

/* Draw the door */
function drawDoor(x, y) {
  console.log(x + "," + y);
  let door = draw.rect(80, 100);
  door.move(x, y);
  door.fill("brown");
  door.stroke({
    width: 2
  });

}
drawDoor(110, 200);
let doorx = 210;
drawDoor(doorx, 200);

/* Draw the roof */
function drawRoof(x, y) {
  let roof =
    draw.polygon([
      [0, 0],
      [150, -100],
      [300, 0]
    ]);
  roof.move(x, y);
}
drawRoof(0, 0);