(09-09-2022, 08:18 PM)SierraKen Wrote: This code can be used in adventure games or any other type of game or app. It makes random looking hills on the screen and when you press the Space Bar it makes different looking ones. I was experimenting with graphics. You can also change the PSET _RGB32 color to blue if you wish to make water waves instead. Just replace the last 0 with the c and the c with a 0.
Code: (Select All)'Random Hills Maker by SierraKen 9-9-2022
_Title "Random Hills Maker - Press Space Bar For Another One - Esc to quit"
Screen _NewImage(800, 600, 32)
start:
_Limit 20
Cls
Paint (10, 10), _RGB32(127, 255, 255)
c = 255
size = (Rnd * 500) + 55
For s = 50 To size Step (size / 10)
For yy = 100 To 650
For i = 0 To 1200
x = Sin((i / s) * 3.1415)
PSet (((i / 360) * 320) - 100, (x * 50) + 50 + yy), _RGB32(0, c, 0)
Next i
c = c - 1
If c < 100 Then c = 255
Next yy
Next s
Do
a$ = InKey$
If a$ = " " Then GoTo start:
If a$ = Chr$(27) Then End
Loop
That was fun. Thanks for sharing!
BAM version: