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 + ...