Official Flower Grove Topic

Drawing random lines was fun! Here’s the code:

@Feinty was right about that if you draw straight lines, you could get awesome designs. I tried his code but a little bit differently.

Code:
// This level is a place for making flower art.
// The real goal is to experiment and have fun!
// If you draw something with at least 1000 flowers, you will "succeed" at the level.
this.setFlowerColor("red");
loop {
    var x = this.pos.x + Math.floor((Math.random() * 8) + 0.5 * 4.56);
    var y = this.pos.y + Math.floor((Math.random() * 8) + 0.5 * 4.56);
    this.moveXY(x, y);
    var X = this.pos.x - Math.floor((Math.random() * 8) + 0.5 * 4.56);
    var Y = this.pos.y - Math.floor((Math.random() * 8) + 0.5 * 4.56);
    this.setFlowerColor("purple");
    this.moveXY(X, Y);
    this.setFlowerColor("yellow");
    this.moveXY(x, Y);
    this.setFlowerColor("blue"); 
    this.moveXY(X, y);
    this.setFlowerColor("red");
    this.moveXY(x, y);
    this.setFlowerColor("pink");
    this.moveXY(X, Y);
    this.setFlowerColor("white");
}

Also, this is one of the only levels that contain peace and harmony. And showing some great artists showing off their talents on drawing.


I’d love to hear your opinions.

14 Likes

I redid my code.

I think it is better that the other ones I made.

Code
// You know, this doesn't take too much effort to obtain. I like drawing straight lines.
// This level is a place for making flower art.
// The real goal is to experiment and have fun!
// If you draw something with at least 1000 flowers, you will "succeed" at the level.
loop {
    var x = this.pos.x;
    var y = this.pos.y;
    var one = Math.floor((Math.random() * 8) + 0.5);
    var two = Math.floor((Math.random() / 8) + 0.5);
    this.setFlowerColor("red");
    this.moveXY(x + one, y - two);
    this.moveXY(x - one, y + two);
    this.setFlowerColor("yellow");
    this.moveXY(x - one, y + one);
    this.moveXY(x + one, y + one);
    this.setFlowerColor("white");
    this.moveXY(x - one, y - two);
    this.moveXY(x - two, y - two);
    this.moveXY(x + one, y + two);
    this.moveXY(x - two, y - two);
    this.setFlowerColor("blue");
    this.moveXY(x + two, y + two);
    this.moveXY(x + one, y + one);
    this.moveXY(x - one, y - two);
    this.moveXY(x + two, y + two);
    this.setFlowerColor("purple");
    this.moveXY(x - one, y - one);
    this.moveXY(x + one, y - one);
    this.moveXY(x + two, y - two);
}

I did this so quickly by the command-c and command-v.

I kind of thought about it. Then…
“Its so easy to obtain this:”

Or that I call the garden of flowers.

And now for the code
loop {
    var x = Math.floor((Math.random() * 19) + 8 * 8);
    var y = Math.floor((Math.random() * 20) + 8 * 8);
    this.setFlowerColor("yellow");
    this.moveXY(x, y);
}

See? Its really easy to try and obtain a Garden Of Flowers and you could change the color if you want to,
Yellow:

White:


red:

blue:

purple:

pink:

14 Likes

Is it a hour glass it is hard to tell because many colors and shapes (mostly lines)

12 Likes

I tried to draw a “dinosaur” or a “dragon” but there wasn’t enough time for that.

Code
loop {
    var x = this.pos.x;
    var y = this.pos.y;
    var one = Math.floor((Math.random() * 10) + 0 * 54.4);
    var two = Math.floor((Math.random() * 10) + 0 * 86);
    this.setFlowerColor("red");
    this.moveXY(x - one, y - two);
    this.setFlowerColor("yellow");
    this.moveXY(x + one, y + two);
    this.setFlowerColor("white");
    this.moveXY(x + one, y - two);
    this.setFlowerColor("pink");
    this.moveXY(x - one, y + one);
    this.setFlowerColor("blue");
    this.moveXY(x + two, y - two);
    this.setFlowerColor("purple");
    this.moveXY(x - one, y);
    this.setFlowerColor("random");
    this.moveXY(x + one, y);
    this.moveXY(x - one, y);
    this.moveXY(x + two, y);
    this.moveXY(x - two, y - 1);
    this.moveXY(x + two, y - 2);
    this.moveXY(x - 3, y - two);
}
15 Likes

Here just two simple fibonacci spirals.
Nothing special, but I think it looks kinda cool.^^

34 Likes

Tharin is our special snowflake.


(Koch fractals; Uses code from the Snowflakes on the Ice and Fractalization levels)

41 Likes

Nice representation of how the Koch-Fractal interacts with itself. Note how the smaller fractal always completes the larger fractal.

17 Likes

Excuse me ,may i disturb you for a second?

and i have a question !!

what is skip doing in this function
’’'
this.drawPolyStars = function(center, radius, sides, skips, startAngle)

‘’’

what is skip??

13 Likes

draw Poly(gon) Stars is a combo function that draws both polygons and stars because the only difference between them is that the stars SKIP vertices of a polygon with the same number of sides. So skips is the number of vertices to skip. (for example: Sides 5 & skip 0 = a pentagon which becomes a pentagram if you skip 1 or 2 vertices. It draws the pentagon “backwards” if you skip 3. And draws nothing (a dot?) if you skip four.)

13 Likes

Beautiful! How long did it take you to make this master piece?

14 Likes

Hi everyone,

Here you have a contribution. Basically, takes a text string and writes it to the screen, according to size, color, text spacing and number of columns and rows.

I’m currently adding more characters, such as numbers and symbols, and I want to add an option to color every character from an array.

I’ll post the code soon, i want to check some issues

UPDATE: If you want to see the code, go to the post: [Mountain Flower Grove] Flower Text Box

33 Likes

A heart floating on waves

Just 2 functions were used: one for a heart shape and one for a cosine wave. Sorry, they may look pretty hacky.

Functions code
def drawWave(y, x_first, x_last, dense=0.05, amp=10, rtl=False):
    X_STEP = 0.5
    self.toggleFlowers(False)
    def draw(x):
        cy = Math.cos(x*dense) * amp
        self.moveXY(x, y + cy)
        self.toggleFlowers(True)
    if rtl:
        x = x_last
        while x >= x_first:
            draw(x)
            x -= X_STEP
        return
    x = x_first
    while x <= x_last:
        draw(x)
        x += X_STEP

def heart(x, y, scale=1):
    self.toggleFlowers(False)
    PI = Math.PI
    def xy(t):
        rad_in_deg = PI/180.0
        coef = 0.01 * (-t*t + 40*t + 1200)
        return (coef * Math.sin(t*rad_in_deg), coef * Math.cos(t*rad_in_deg))
    def draw(t, mul=1):
        current_x, current_y = xy(t)
        current_x *= scale*mul
        current_y *= scale
        self.moveXY(x + current_x, y + current_y)
        self.toggleFlowers(True)
    for t in range(61):
        draw(t)
    self.toggleFlowers(False)
    for t in range(60, -1, -1):
        draw(t, -1)

The specific function arguments for the picture is a secret of art. The main idea is that just slightly varying parameters of shapes you can get something interesting.

Bonus: heart curves inspiration link

27 Likes

cool flower art:grinning:

11 Likes

I made that screensaver which is on every computer where the thing hits the edge of the screen and changes color:

code
self.toggleFlowers(True)
newVector = Vector(1, 1)
colors = ['pink', 'red', 'yellow', 'blue', 'purple', 'white', 'random']
currentColor = None
choice = 0
loop:
    if not self.isPathClear(self.pos, {'x':self.pos.x, 'y':self.pos.y+2}):
        newVector = Vector.add(newVector, Vector(0,-2))
        choice += 1
    elif not self.isPathClear(self.pos, {'x':self.pos.x, 'y':self.pos.y-2}):
        newVector = Vector.add(newVector, Vector(0,2))
        choice += 1
    if not self.isPathClear(self.pos, {'x':self.pos.x + 2, 'y':self.pos.y}):
        newVector = Vector.add(newVector, Vector(-2,0))
        choice += 1
    elif not self.isPathClear(self.pos, {'x':self.pos.x - 2, 'y':self.pos.y}):
        newVector = Vector.add(newVector, Vector(2,0))
        choice += 1
    if currentColor is not colors[choice%len(colors)]:
        currentColor = colors[choice%len(colors)]
        self.setFlowerColor(currentColor)
    moveTo = Vector.add(newVector, self.pos)
    self.move(moveTo)
22 Likes

Incredible, can you send me the code, please? I want to know how to define such a function.My email address:630116613@qq.com

9 Likes

Incredible, can you send me the code, please? I want to know how to define such a function.My email address:630116613@qq.com

9 Likes

This was written below his post:

If you want to see the code, go to the post: [Mountain Flower Grove] Flower Text Box

You need to:

  1. Click on the link
  2. Click on the little triangle where it says Message Flower Box Code v1.0 NEW!!!
12 Likes

my initial thought was to do random as well, but i couldn’t get it to work in python.

10 Likes


A continuous line / ripple
theta = 2cos5r

30 Likes

Thats so cool.:heart_eyes::open_mouth::thumbsup:!!! I probably cant do stuff like that (yet)…

13 Likes