HELP AGAIN AHHH PLS its's the Geometry of flowers

Sorry if I ask help too much but it’s just some complicated!!!
here is my code:

# You now have the Ring of Flowers! You can do:
# toggleFlowers(True/False) - turns flowers on or off.
# setFlowerColor("random") - can also be "pink", "red", "blue", "purple", "yellow", or "white".

# Here are some functions for drawing shapes:
# x, y - center of the shape
# size - size of the shape (radius, side length)
def drawCircle(x, y, size):
    angle = 0
    hero.toggleFlowers(False)
    while angle <= Math.PI * 2:
        newX = x + (size * Math.cos(angle))
        newY = y + (size * Math.sin(angle))
        hero.moveXY(newX, newY)
        hero.toggleFlowers(True)
        angle += 0.2

def drawSquare(x, y, size):
    hero.toggleFlowers(False)
    cornerOffset = size / 2
    hero.moveXY(x - cornerOffset, y - cornerOffset)
    hero.toggleFlowers(True)
    hero.moveXY(x + cornerOffset, y - cornerOffset)
    hero.moveXY(x + cornerOffset, y + cornerOffset)
    hero.moveXY(x - cornerOffset, y + cornerOffset)
    hero.moveXY(x - cornerOffset, y - cornerOffset)


redX = {"x": 28, "y": 36}
whiteX = {"x": 44, "y": 36}

# Pick a color.
hero.setFlowerColor("red")
# Draw a size 10 circle at the redX.

# Change the color!
hero.setFlowerColor("white")
# Draw a size 10 square at the whiteX.

# Now experiment with drawing whatever you want!

1 Like

Have you tried it by yourself?

1 Like

yes I tried it (2000000)

1 Like

okay, I’m just loading up the level and analysing the code

1 Like

the only reason I don’t get it is the place it says draw a size 10 circle or square at the reX or whiteX

1 Like

All you need to do is use the function drawCircle(x, y, size). By use, I mean type it out on the screen e.g.

drawCircle(x, y, size) #just like that!

This will draw a circle.
However, you don’t put in x, y or size, you replace them with number values. So the redX location is:

Meaning you put in 28 for the x value in the brackets of the function, 36 for the y value, and

Now fill in the whiteX values and size 10 in the drawSquare(x, y, size) function.
I hope that helps.
Danny

2 Likes

this is what happened when I added all of the code’s im supposed to add:

This is what happened and somebody pls reply:

I drew a circle at both places and it says I didn’t draw it at the white X

It’s because on line 39 you do: drawCircle() Instead, you want to do drawSquare(). Remember the comments say:

3 Likes

ohhh ok thank’s for catching the mistake!

1 Like

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.