Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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


Possibly Related Threads…
Thread Author Replies Views Last Post
  Bouncing lines & boxes Dav 6 1,967 04-12-2025, 06:14 AM
Last Post: madscijr
  A bigger bouncing ball demo - collision with vector reflection Dav 14 3,224 09-19-2024, 06:54 PM
Last Post: sbblank
  Bilateral Kaleidoscope bplus 4 1,156 01-03-2023, 06:15 PM
Last Post: Kernelpanic
  Kaleidoscope SierraKen 8 1,987 05-29-2022, 04:12 PM
Last Post: Rick3137

Forum Jump:


Users browsing this thread: 1 Guest(s)