Tree Maker
#3
Sure B+, I'll put up a graphic on that topic thread. There's 2 ways that I get mp3's, either I buy them off Amazon to download or I rip them off the CD's I buy using Windows Media Player.

I just made this tree maker into an orchard maker with 20 random smaller trees. Smile

Press the space bar to make another random orchard.


[Image: Orchard-Maker-by-Sierra-Ken.jpg]



Code: (Select All)
'Tree Orchard Maker by SierraKen - September 2, 2022.
'Feel free to use this in any code.
'The screen cannot have _RGB32(255, 125, 127) because it uses that PSET point as a plot value.
Screen _NewImage(800, 600, 32)
_Title "Orchard Maker - Press Space Bar for another orchard - Esc to end"
start:
_Limit 20
Cls
For y = 200 To 600
    c1 = c1 + .5
    Line (0, y)-(800, y), _RGB32(0, c1, 0)
Next y
c1 = 0
For trees = 1 To 40 Step 2
    x2 = Rnd * 800
    y2 = (Rnd * 400) + 200
    Line (x2 - 3, y2)-(x2 + 3, y2 - 25), _RGB32(255, 127, 127), BF
    PSet (x2, y2 - 20), _RGB32(255, 125, 127 + trees)
    limbsy = 490
    size = 25
    For stories = 1 To 5 '<<<<<<< Experiment with this number.
        size = size - .5 '<<<<<<< Experiment with this number.
        For yy = 0 To 600
            For xx = 0 To 800
                If Point(xx, yy) = _RGB32(255, 125, 127 + trees) Then
                    limbsx = xx
                    limbsy = yy
                    seconds = (Rnd * 8) + 5
                    s = (60 - seconds) * 6 + 180
                    x = Int(Sin(s / 180 * 3.141592) * size) + limbsx
                    y = Int(Cos(s / 180 * 3.141592) * size) + limbsy
                    For b = 2 To -2 Step -.1
                        Line (limbsx + b, limbsy)-(x + b, y), _RGB32(255, 127, 127)
                        Line (limbsx + b, limbsy)-(x + b, y), _RGB32(255, 127, 127)
                    Next b
                    PSet (x, y), _RGB32(255, 125, 127 + trees)
                    seconds = (Rnd * 9) + 47
                    s = (60 - seconds) * 6 + 180
                    x = Int(Sin(s / 180 * 3.141592) * size) + limbsx
                    y = Int(Cos(s / 180 * 3.141592) * size) + limbsy
                    For b = 2 To -2 Step -.1
                        Line (limbsx + b, limbsy)-(x + b, y), _RGB32(255, 127, 127)
                        Line (limbsx + b, limbsy)-(x + b, y), _RGB32(255, 127, 127)
                    Next b
                    PSet (x, y), _RGB32(255, 125, 127 + trees)
                End If
            Next xx
        Next yy
    Next stories

    size = 25
Next trees
Do:
    _Limit 20
    a$ = InKey$
    If a$ = " " Then GoTo start:
    If a$ = Chr$(27) Then End
Loop
Reply


Messages In This Thread
Tree Maker - by SierraKen - 09-02-2022, 06:32 PM
RE: Tree Maker - by bplus - 09-02-2022, 06:50 PM
RE: Tree Maker - by SierraKen - 09-02-2022, 07:10 PM
RE: Tree Maker - by SierraKen - 09-03-2022, 07:37 PM
RE: Tree Maker - by James D Jarvis - 09-03-2022, 09:28 PM



Users browsing this thread: 1 Guest(s)