Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple Random Hills Maker
#5
Oh what the hill?

Code: (Select All)
_Title "Rnd Hills" 'b+ 2022-09-10
Screen _NewImage(800, 600, 32)
Randomize Timer
Do
    a = 0: b = 0
    For y = 0 To 500
        Line (0, y)-(_Width - 1, y), _RGB32(100, 100, y / 500 * 155 + 100)
    Next
    For y = 300 To 500 Step 25
        a = .1 * a + Rnd * 30 - 15: b = .1 * b + Rnd * 60 - 30
        For x = 0 To 800
            h = y + a * Sin(_D2R(2 * x)) + b * Sin(_D2R(.5 * x))
            Line (x, h)-(x, _Height), _RGB32(0, 200 - 128 * (y - 300) / 200, 0)
        Next
    Next
    Sleep
Loop Until _KeyDown(27) 'escape
b = b + ...
Reply


Messages In This Thread
Simple Random Hills Maker - by SierraKen - 09-09-2022, 08:18 PM
RE: Simple Random Hills Maker - by CharlieJV - 09-10-2022, 04:06 AM
RE: Simple Random Hills Maker - by 40wattstudio - 09-10-2022, 01:56 PM
RE: Simple Random Hills Maker - by SierraKen - 09-10-2022, 08:06 PM
RE: Simple Random Hills Maker - by bplus - 09-10-2022, 10:32 PM
RE: Simple Random Hills Maker - by dbox - 09-11-2022, 03:47 AM



Users browsing this thread: 1 Guest(s)