Homework 1B Starter
Create your House functions in this Fiddle. Then follow the instructions in the comments to move the functions to a Brackets project during your Week 2 lab session.
by Prathameshsb
HTML
<div id="drawing">
</div>
JavaScript
"use strict"
/* ----------------------------
Start of test.js
----------------------------
*/
//Set up drawings
let draw = SVG("drawing");
// Set up canvas sizes
draw.size(600,400);
//Grid box
let box = draw.rect(600,400).fill("none").stroke("#FF4828").stroke({width: 2});
/*-------All the Calling functions-------*/
//Calling the Roof Function which will create a Triangle with the x-coordinates = 50 and y-coordinates = 5.
roofA4(draw,50,5);
//Calling the Base Function which will create 2 rectangles with the x-coordinates = 50 and y-coordinates = 75.
baseA4(draw,50,75);
//Calling the Window A Function which will create small circular shaped windows with the x-coordinates = 150 and y-coordinates = 130.
windowAA4(draw,300,195);
//Calling the Window C Function which will create the Rectangular shaped windows with the x-coordinates = 375 and y-coordinates = 195.
windowBA4(draw,375,195);
//Calling the Doorway Function which will create the Oval shaped Door with the x-coordinates = 75 and y-coordinates = 225.
doorwayA4(draw,75,225);
/*
-------------------------------------
End of test.js
-------------------------------------
*/
/* ----------------------------
Start of function.js
----------------------------
*/
/*------------Roof Top------------*/
/*
Function: roof
Description: Draws a Triangle shape roof that is grey in color.
Origin point for this object is the upper left corner.
Parameters: d = SVG drawing area,
x = horizontal coordinate,
y = vertical coordinate
*/
function roofA4(d,x,y){
let roof = d.polygon("300,5 550,75 50,75");
roof.fill('#969696');
roof.stroke('#E56FBB');
roof.stroke({width:2});
roof.move(x,y);
}
/*------------End of Roof top code------------*/
/*------------Base of the House------------*/
/*
Function: baseA4
Description: Draws 2 rectangular shape boxes where the...