Hi,
I am doing the sprouting flower exercise. As pointed out in the instructions, i am working on one part at a time. Like, i have started with drawing the flower head, pistil and now i am struck at the stem part. The error i am getting is that The first stem isn’t correct. I have gone over the instructions time and again but don’t know why i am not able to get over the error. There is some thing i am missing that i am not able to figure out.
let canvasSize = 100
let topStem = 90 //top left y co ordinate
let stemHeight = canvasSize - topStem
let stemWidth = stemHeight / 10
// since stem is centered around x axis as given, center of stem = (50,90)
let leftStem = 50 - (stemWidth/2) //top left x co ordinate
repeat(61){
rectangle(0, 0, 100, 90, "skyblue") //sky
rectangle(0, 90, 100, 10, "green") //ground
rectangle(leftStem, topStem, stemWidth, stemHeight, "green")
topStem = topStem - 1 //since the flower center has to move up by 1
stemHeight = stemHeight + 1
}
Few key points i want to verify if i have taken correctly from the instructions
The stem should start at the center of the flower and reach the ground.
Does this mean that the (left,top) co-ordinates of the rectangle are same as the center co-ordinates of the flower?
Everything is centered on the horizontal axis.
Does this mean the center of the stem (rectangle) is equal to the center of the flower and we have to then calculate the (top, left) co-ordinates of the rectangle like i have done in the code i pasted above.
Went through the instructions and working out on this for a while now. I know there is something i am missing, but i dont quite know exactly, it is that sort of feeling ![]()

