Simple Random Hills Maker
#1
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
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: 3 Guest(s)