Bouncing Kaleidoscope
#1
[Image: Bouncing-Kaleidoscope-by-Sierra-Ken.png]

This is like my other Kaleidoscope but it is much smaller and bounces off the walls. Smile I decided to make it a different thread since they are really completely different. I'll post a picture below. 

Code: (Select All)
'Bouncing Kaleidoscope by SierraKen
'May 18, 2022
Screen _NewImage(800, 800, 32)
_Title "Bouncing Kaleidoscope by SierraKen"
Randomize Timer
cc = 1
dirx = 1
diry = 1
cenx = 400
ceny = 400
Do
    Do
        _Limit 100
        If c <> 0 Then cc = c
        c = Rnd * 100
        If c < cc Then
            s = -.25
        Else
            s = .25
        End If
        cl1 = Int(Rnd * 200) + 1
        cl2 = Int(Rnd * 200) + 1
        cl3 = Int(Rnd * 200) + 1
        cenx = cenx + dirx
        ceny = ceny + diry
        If cenx > 700 Then dirx = -1 * Rnd * 3
        If cenx < 100 Then dirx = 1 * Rnd * 3
        If ceny > 700 Then diry = -1 * Rnd * 3
        If ceny < 100 Then diry = 1 * Rnd * 3
        For t = cc To c Step s
            x = (Sin(t) * t) + cenx
            y = (Cos(t) * t) + ceny
            Circle (x, y), 2, _RGB32(cl1, cl2, cl3)
        Next t
        lp = lp + 1
    Loop Until lp > 20
    lp = 0
    _Display
    Line (0, 0)-(800, 800), _RGB32(0, 0, 0, 10), BF
Loop Until InKey$ = Chr$(27)
Reply




Users browsing this thread: 1 Guest(s)