DAY 015: PRESET
#2
Fun with Day 015 word:
Code: (Select All)
_Title "PSet or PReset" ' b+ 2022-11-20
Screen _NewImage(800, 600, 32)
_ScreenMove 200, 50
Do
    If lc Mod 200 = 0 Then
        lc = 0
        c1~& = _RGB32(Rnd * 200 + 55, Rnd * 255, Rnd * 255)
        Color , _RGB32(255 - _Red32(c1~&), 255 - _Blue32(c1~&), 255 - _Green32(c1~&))
        Cls
    End If
    box Rnd * _Width - 80, Rnd * _Height - 60, Rnd * 160 + 1, Rnd * 120 + 1, c1~&
    _Limit 10
    lc = lc + 1
Loop Until _KeyDown(27)

Sub box (x, y, w, h, c~&)
    For yy = y To y + h
        For xx = x To x + w
            If Point(xx, yy) = c~& Then PReset (xx, yy) Else PSet (xx, yy), c~&
        Next
    Next
End Sub
b = b + ...
Reply


Messages In This Thread
DAY 015: PRESET - by SMcNeill - 11-20-2022, 03:42 PM
RE: DAY 015: PRESET - by bplus - 11-20-2022, 05:54 PM
RE: DAY 015: PRESET - by mnrvovrfc - 11-20-2022, 08:45 PM
RE: DAY 015: PRESET - by PhilOfPerth - 11-20-2022, 10:51 PM



Users browsing this thread: 1 Guest(s)