Question: Create a cityscape using functions and parameters!To do this, you need to write a function called drawBuilding ( ) that draws a ( rectangle )
Create a cityscape using functions and parameters!To do this, you need to write a function called drawBuilding that draws a rectangle building. This function should take as parameters the width of the building, the height of the building, and the xposition of the building remember where rectangles positions are anchored!drawBuildingbuildingWidth buildingHeight, buildingX;JavaScriptYou also need to define a drawLightPole function that is called when the building is taller than as stored in LIGHTREQUIREDHEIGHT. This light pole is made of a skinny rectangular pole with a circle warning light on top. The function should take in the parameters of the xposition, yposition, and height of the pole.drawLightPolepoleX poleY, poleHeight;JavaScriptOther Requirements:The bottom of all buildings should be located on the bottom edge of the canvas.The height of the pole is th the height of the building it is sitting onThe width of the pole is as assigned to POLEWIDTH, and should be centered horizontally on the top of the building.The warning light is a green circle of radius sitting directly on top of the pole the middle of the circle should be located at the center of the top of the pole.IMPORTANT:In order to pass the test cases and the assignment, you must include a building with the following arguments:drawBuilding;Other than that, draw as many buildings as youd like! Below is an example of what your city could look like. Again, you only need the above building to pass the Test Cases, the rest is up to you!Challenge:Try adding windows and a door to your buildings! Get creative, use ifelse statements to place features on some buildings and not others.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
