zhennan hao'sWeek2 Customized house

by zhennan hao

HTML

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

JavaScript

/*week2 customized house-two tree houses
zhennan hao
09/28/2018*/

"use strict"
var draw = SVG('drawing').size(600, 400);

//add the left tree.
function drawTree1(Tx,Ty){
/* This function draw the left tree
It has 2 parameters
1) Tx = the x location of the tree
2) Ty = the y location of the tree
*/
var tree = draw.rect(115,200).fill('#6a4f33').stroke({width:3});
tree.move(Tx, Ty);
}
		drawTree1(90,220)

//add the right tree.
function drawTree(w,h,xps,c,s) {
/* This function draw the tree
It has 5 parameters
1) w = the width of the tree
2) h = the height of the tree
3) xps = x location of the tree
4) c = the color of the tree
5) s = stroke's width
*/
var tree = draw.rect(w,h).fill(c).stroke({width:s});
tree.x(xps)
}
		drawTree(115,600,400,'#6a4f33',3)


	



//add the left house.
function drawHouse(w,h,xps,yps,c,s) {
/* This function draw the house
It has 6 parameters
1) w = the width of the house
2) h = the height of the house
3) xps = x location of the house
4) yps = y location of the house
5) c = the color of the house
6) s = stroke's width
*/
var house = draw.rect(w,h).fill(c).stroke({width:s});
house.x(xps); house.y(yps)
}
		drawHouse(260,150,20,200,'#98754d',3)
//add the right house.
function drawHouse2(w,h,wall2xp,wall2yp,c,s){
//this function has 6 parameters
//w=width
//h=height
//wall2xp=x location of wall2
//wall2yp=y location of wall2
//c=color
//s=stroke
var wall2 =draw.rect(w,h).fill(c).x(wall2xp).y(wall2yp).stroke({ width: s });}
		drawHouse2(270,155,320,0,'#98754d',2);





//add the left base.
function drawBase1(w,h,xps,yps,c,s) {
/* This function draw the base
It has 6 parameters
1) w = the width of the base
2) h = the height of the base
3) xps = x location of the base
4) yps = y location of the base
5) c = the color of the base
6) s = stroke's width
*/
var base = draw.rect(w,h).fill(c).stroke({width:s});
base.x(xps); base.y(yps)
}
		drawBase1(550,25,10,350,'#c39765',3)
//add the right base.
function drawBase(w,h,xps,yps,c,s) {
/* This function...