Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plasma Studies
#10
But what would Pete do?

Maybe this:
Code: (Select All)
_Title "Ansii Plasma - press spacebar for new set of points, be sure to swirl your mouse in the stuff!" ' b+ 2021-11-11
_ScreenMove 100, 40

Type xy
    x As Single
    y As Single
    dx As Single
    dy As Single
End Type

Randomize Timer
Width 150, 80
_Font 8

nP = 6
Dim p(1 To nP) As xy, f(6)

restart:
For n = 1 To nP
    p(n).x = Rnd * _Width: p(n).y = Rnd * _Height: p(n).dx = .25 * (Rnd * 2 - 1): p(n).dy = 2 * (Rnd * 2 - 1)
    f(n) = n * .015
Next

While _KeyDown(27) = 0
    Cls
    If InKey$ = " " Then GoTo restart
    For i = 1 To nP - 1
        p(i).x = p(i).x + p(i).dx
        If p(i).x > _Width - 1 Or p(i).x < 1 Then p(i).dx = -p(i).dx
        If p(i).x < 1 Then p(i).x = 1: If p(i).x > _Width Then p(i).x = _Width
        p(i).y = p(i).y + p(i).dy
        If p(i).y > _Height Or p(i).y < 1 Then p(i).dy = -p(i).dy
        If p(i).y < 1 Then p(i).y = 1: If p(i).y > _Height Then p(i).y = _Height
    Next
    While _MouseInput: Wend
    p(nP).x = _MouseX: p(nP).y = _MouseY
    For y = 1 To _Height
        For x = 1 To _Width
            d = 0
            For n = 1 To nP
                dx = x - p(n).x: dy = y - p(n).y
                k = Sqr(dx * dx + dy * dy)
                d = d + (Sin(k * f(n)) + 1) / 2
            Next
            Locate y, x: Print Chr$(Int(d * 20));
        Next
    Next
    _Display
    _Limit 40
Wend

   
b = b + ...
Reply


Messages In This Thread
Plasma Studies - by bplus - 05-03-2022, 08:03 PM
RE: Plasma Studies - by bplus - 05-03-2022, 08:08 PM
RE: Plasma Studies - by bplus - 05-03-2022, 08:12 PM
RE: Plasma Studies - by bplus - 05-03-2022, 08:16 PM
RE: Plasma Studies - by bplus - 05-03-2022, 08:21 PM
RE: Plasma Studies - by bplus - 05-03-2022, 08:26 PM
RE: Plasma Studies - by bplus - 05-03-2022, 08:31 PM
RE: Plasma Studies - by bplus - 05-03-2022, 08:35 PM
RE: Plasma Studies - by bplus - 05-03-2022, 08:38 PM
RE: Plasma Studies - by bplus - 05-03-2022, 08:45 PM
RE: Plasma Studies - by bplus - 05-03-2022, 08:49 PM
RE: Plasma Studies - by Dav - 05-03-2022, 11:16 PM
RE: Plasma Studies - by bplus - 05-03-2022, 11:53 PM
RE: Plasma Studies - by Coolman - 05-04-2022, 11:00 AM
RE: Plasma Studies - by vince - 05-05-2022, 12:34 AM



Users browsing this thread: 5 Guest(s)