SimpleHouse
by ZhenLiu
HTML
<div id="SimpleHouse"></div>
JavaScript
"use strict"
var draw = SVG("SimpleHouse").size(600,400)
function drawwall1(w,h,wall1xp,wall1yp,c,s){
//this function has 6 parameters
//w=width
//h=height
//wall1xp=x location of wall1
//wall1yp=y location of wall1
//c=color
//s=stroke
var wall1 = draw.rect(w,h ).fill(c).x(wall1xp).y(wall1yp).stroke({ width: s });
}
drawwall1(110,400,245,0,'#F0FFF0',2);
function drawwall2(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 });}
drawwall2(290,155,50,105,'#ffa500',2);
function drawwin2(w,h,win2x,win2y,c,s){
//this function has 6 parameters
//w=width
//h=height
//win2x=x location of win2
//win2y=y location of win2
//c=color
//s=stroke
var win2= draw.rect(w,h).fill(c).x(win2x).y(win2y).stroke({ width: s });}
drawwin2(75,60,60,115,'#F0FFF0',2)
function drawwin2line(x1,y1,x2,y2,s){
//this function has 5 parameters
//x1=x location of the first point
//y1=y location of the first point
//x2=x location of the second point
//y2=y location of the second point
//s=stroke
var win2line=draw.line(x1,y1, x2,y2).stroke({ width: s });}
drawwin2line(60,145,135,145,2);
function drawwin3(w,h,x,y,c,s){
//this function has 6 parameters
//w=width
//h=height
//x=x location of win3
//y=y location of win3
//c=color
//s=stroke
var win3=draw.rect(w,h).fill(c).move(x,y).stroke({ width: s });}
drawwin3(75,60,60,185,'#F0FFF0',2);
function drawwin3line(x1,y1,x2,y2,s){
//this function has 5 parameters
//x1=x location of the first point
//y1=y location of the first point
//x2=x location of the second point
//y2=y location of the second point
//s=stroke
var win3line=draw.line(x1,y1,x2,y2 ).stroke({ width: s });}
drawwin3line(60,215,135,215,2);
function drawwin1(w,h,x,y,c,s){
//this function has 6 parameters
//w=width
//h=height
//x=x location of win1
//y=y location of win1
//c=color
//s=stroke
var...