|
Post by tsh73 on Dec 22, 2021 13:33:06 GMT -5
... Falling letters makes my think of the Matrix movie out today. Anyone have a Matrix screensaver in Liberty BASIC handy for the ocassion? Falling green letters? Matrix screensaver? Why, I had to do it some time ago! *after some searching* No, not in my sources / downloaded sources *after searching LB Forum* Not here either So. To a fresh start? You know how it supposed to look, right? It even has got special word and Wikipedia article Matrix digital rainGentlemen, start your BASICs! EDIT
Some code to get you started. 'matrix screensaver - start of the contest
nomainwin
open "test" for graphics_nsb_nf as #gr #gr "home; down; posxy cx cy; fill black" #gr "trapclose [quit]"
#gr "font courier 16 16 bold" #gr "backcolor black; color green"
read a$ timer 50, [tick]
[new] x=(2*cx-16)*rnd(0) y=16+16*rnd(0) #gr "place ";x;" ";y wait
[tick] if a$="" then read a$ if a$ = "xyzzy" then restore c$=left$(a$,1):a$=mid$(a$,2) #gr "\";c$ #gr "posxy x y" if y >2*cy-16 then [new]
wait
[quit] timer 0 close #gr end
DATA "Falling green letters? Matrix screensaver? Why, I had to do it some time ago!" DATA "*after some searching*" DATA "No, not in my sources / downloaded sources" DATA "*after searching LB Forum*" DATA "Not here either" DATA "" DATA "So. To a fresh start?" DATA "You know how it supposed to look, right?" DATA "It even has got special word and Wikipedia article" DATA "Matrix digital rain"
DATA "Gentlemen, start your BASICs!" DATA "xyzzy"
|
|
|
Post by Rod on Dec 23, 2021 10:29:39 GMT -5
My clumsy effort.
nomainwin WindowWidth = 800 WindowHeight = 600 UpperLeftX = int((DisplayWidth-WindowWidth)/2) UpperLeftY = int((DisplayHeight-WindowHeight)/2) open "Matrix" for graphics_nsb as #1 #1 "down ; trapclose [quit]" #1 "font courier_new 12 " s=250 dim s(s,3) for n= 1 to s #1 "color black ; backcolor white" c=int(rnd(0)*65+65) #1 "place 0 14;\";chr$(c) #1 "color green ; backcolor black" #1 "\";chr$(c) #1 "getbmp b";n;" 0 0 11 36" #1 "addsprite s";n;" b";n s(n,1)=int(rnd(0)*60)*13 s(n,2)=int(rnd(0)*33)*18 s(n,3)=int(rnd(0)*20)+2 #1 "spritexy s";n;" ";s(n,1);" ";s(n,2) next #1 "fill black ; getbmp bac 0 0 800 600 ; background bac" #1 "drawsprites"
timer 56, [frame] wait
[frame] for n= 1 to s s(n,2)=s(n,2)+s(n,3) if rnd(0)>.75 then if rnd(0)>.5 then #1 "spriteorient s";n;" mirror" else #1 "spriteorient s";n;" normal" if s(n,2)>600 then s(n,2)=s(n,2)=0-rnd(0)*100 #1 "spritexy s";n;" ";s(n,1);" ";s(n,2) next #1 "drawsprites" wait
[quit] timer 0 close #1 end
|
|
|
Post by Carl Gundel on Dec 23, 2021 12:44:39 GMT -5
I quite like your clumsy effort. Here is my tweak of your clumsy effort.
nomainwin WindowWidth = 800 WindowHeight = 600 UpperLeftX = int((DisplayWidth-WindowWidth)/2) UpperLeftY = int((DisplayHeight-WindowHeight)/2) open "Matrix" for graphics_nsb as #1 #1 "down ; trapclose [quit]" #1 "font courier_new 12 " s=250 dim s(s,3) for n= 1 to s #1 "color black ; backcolor white" c=int(rnd(0)*65+65) c$ = chr$(c) #1 "place 0 14" #1 "\";c$;"\";c$;"\";c$ #1 "color 0 70 0 ; backcolor black" #1 "\";chr$(c) #1 "color darkgreen ; backcolor black" #1 "\";chr$(c) #1 "color green ; backcolor black" #1 "\";chr$(c) #1 "getbmp b";n;" 1 1 10 107" #1 "addsprite s";n;" b";n s(n,1)=int(rnd(0)*60)*13 s(n,2)=int(rnd(0)*33)*18 s(n,3)=int(rnd(0)*20)+2 #1 "spritexy s";n;" ";s(n,1);" ";s(n,2) next #1 "fill black ; getbmp bac 0 0 800 600 ; background bac" #1 "drawsprites"
timer 100, [frame] wait
[frame] for n= 1 to s - 1 s(n,2)=s(n,2)+s(n,3)+1 if rnd(0)>.75 then if rnd(0)>.5 then #1 "spriteorient s";n;" mirror" else #1 "spriteorient s";n;" normal" if s(n,2)>600 then s(n,2)=s(n,2)=0-rnd(0)*100 #1 "spritexy s";n;" ";s(n,1);" ";10 * int(s(n,2) / 10) next #1 "drawsprites" wait
[quit] timer 0 close #1 end
|
|
|
Post by Rod on Dec 23, 2021 14:37:32 GMT -5
Very cool. It locked up into a loop on my PC, iMac M1, so I took out the timer and it runs and stops just fine.
nomainwin WindowWidth = 800 WindowHeight = 600 UpperLeftX = int((DisplayWidth-WindowWidth)/2) UpperLeftY = int((DisplayHeight-WindowHeight)/2) open "Matrix" for graphics_nsb as #1 #1 "down ; trapclose [quit]" #1 "font courier_new 12 " s=250 dim s(s,3) for n= 1 to s #1 "color black ; backcolor white" c=int(rnd(0)*65+65) c$ = chr$(c) #1 "place 0 14" #1 "\";c$;"\";c$;"\";c$ #1 "color 0 70 0 ; backcolor black" #1 "\";chr$(c) #1 "color darkgreen ; backcolor black" #1 "\";chr$(c) #1 "color green ; backcolor black" #1 "\";chr$(c) #1 "getbmp b";n;" 1 1 10 107" #1 "drawbmp b";n;" 25 25" #1 "addsprite s";n;" b";n s(n,1)=int(rnd(0)*60)*13 s(n,2)=int(rnd(0)*33)*18 s(n,3)=int(rnd(0)*20)+2 #1 "spritexy s";n;" ";s(n,1);" ";s(n,2) next #1 "fill black ; getbmp bac 0 0 800 600 ; background bac" #1 "drawsprites"
[frame] for n= 1 to s - 1 s(n,2)=s(n,2)+s(n,3)+1 if rnd(0)>.75 then if rnd(0)>.5 then #1 "spriteorient s";n;" mirror" else #1 "spriteorient s";n;" normal" if s(n,2)>600 then s(n,2)=s(n,2)=0-rnd(0)*100 #1 "spritexy s";n;" ";s(n,1);" ";10 * int(s(n,2) / 10) next #1 "drawsprites" scan goto [frame]
[quit] close #1 end
|
|
|
Post by Brandon Parker on Dec 23, 2021 15:52:34 GMT -5
I think it might "need" the timer. On my machine, it speeds up & slows down depending on processor usage pretty noticeably.
Here is my take on Carl's example with a few adjustments... 1. Make longer strings 2. Make the last letter white 3. Start them off the top of the window that way the entire window fills up
NoMainWin WindowWidth = 800 WindowHeight = 600 UpperLeftX = int((DisplayWidth-WindowWidth)/2) UpperLeftY = int((DisplayHeight-WindowHeight)/2) Open "Matrix" For graphics_nsb As #1 #1 "Down ; TrapClose [quit]" #1 "Font Courier_New 12 " s=250 Dim s(s,3) For n = 1 To s #1 "Color Black ; BackColor White" c=int(rnd(0)*65+65) c$ = chr$(c) #1 "Place 0 14" #1 "\";c$;"\";c$;"\";c$;"\";c$;"\";c$;"\";c$;"\";c$;"\";c$;"\";c$ For i = 1 To 3 #1 "Color 0 70 0 ; BackColor Black" #1 "\";chr$(c) #1 "Color DarkGreen ; BackColor Black" #1 "\";chr$(c) If i = 3 Then color$ = "White" Else color$ = "Green" #1 "Color ";color$;"; BackColor Black" #1 "\";chr$(c) Next i #1 "GetBMP b";n;" 1 1 10 322" #1 "DrawBMP b";n;" 25 25" #1 "AddSprite s";n;" b";n s(n,1)=int(rnd(0)*60)*13 s(n,2)=int(rnd(0)*33)*-50 s(n,3)=int(rnd(0)*20)+2 #1 "SpriteXY s";n;" ";s(n,1);" ";s(n,2) Next n #1 "Fill Black ; GetBMP bac 0 0 800 600 ; Background bac" #1 "DrawSprites"
Timer 100, [frame] Wait
[frame] Scan For n = 1 To s - 1 s(n,2)=s(n,2)+s(n,3)+1 If rnd(0)>.75 Then If rnd(0)>.5 Then #1 "SpriteOrient s";n;" Mirror" Else #1 "SpriteOrient s";n;" Normal" If s(n,2)>600 Then s(n,2)=s(n,2)=0-rnd(0)*100 #1 "SpriteXY s";n;" ";s(n,1);" ";10 * int(s(n,2) / 10) Next n #1 "DrawSprites" Wait
[quit] Timer 0 Close #1 End
{:0)
Brandon Parker
|
|
|
Post by Brandon Parker on Dec 23, 2021 16:34:54 GMT -5
And here is a slightly further enhanced version giving even more randomness to the strings...
NoMainWin WindowWidth = 800 WindowHeight = 600 UpperLeftX = int((DisplayWidth-WindowWidth)/2) UpperLeftY = int((DisplayHeight-WindowHeight)/2) Open "Matrix" For graphics_nsb As #1 #1 "Down ; TrapClose [quit]" #1 "Font Courier_New 12 " s=250 Dim s(s,3) Dim c$(8) For n = 1 To s #1 "Color Black ; BackColor White" For i = 0 To 8 c$(i) = Chr$(Int(rnd(0) * 223) + 33) Next i #1 "Place 0 14" #1 "\";c$(0);"\";c$(1);"\";c$(2);"\";c$(3);"\";c$(4);"\";c$(5);"\";c$(6);"\";c$(7);"\";c$(8) #1 "Color Black; BackColor Black; Place 0 163" #1 "BoxFilled 14 365" #1 "Place 0 180" For ii = 0 To 6 Step 3 #1 "Color 0 70 0 ; BackColor Black" #1 "\";c$(ii) #1 "Color DarkGreen ; BackColor Black" #1 "\";c$(ii + 1) If ii = 6 Then color$ = "White" Else color$ = "Green" #1 "Color ";color$;"; BackColor Black" #1 "\";c$(ii + 2) Next ii #1 "GetBMP b";n;" 1 1 10 325" #1 "DrawBMP b";n;" 25 25" #1 "AddSprite s";n;" b";n s(n,1) = Int(Rnd(0)*60)*13 s(n,2) = Int(Rnd(0)*33)*-50 s(n,3) = Int(Rnd(0)*20)+2 #1 "SpriteXY s";n;" ";s(n,1);" ";s(n,2) Next n #1 "Fill Black ; GetBMP bac 0 0 800 600 ; Background bac" #1 "DrawSprites"
Timer 100, [frame] Wait
[frame] Scan For n = 1 To s s(n,2)=s(n,2)+s(n,3)+1 If rnd(0)>.75 Then If rnd(0)>.5 Then #1 "SpriteOrient s";n;" Mirror" Else #1 "SpriteOrient s";n;" Normal" If s(n,2)>600 Then s(n,2)=0-rnd(0)*100 #1 "SpriteXY s";n;" ";s(n,1);" ";10 * int(s(n,2) / 10) Next n #1 "DrawSprites" Wait
[quit] Timer 0 Close #1 End
{:0)
Brandon Parker
|
|
|
Post by Carl Gundel on Dec 23, 2021 17:38:14 GMT -5
I accidentally left in the following, which I was using for debugging:
#1 "drawbmp b";n;" 25 25"
|
|
|
Post by Carl Gundel on Dec 23, 2021 17:41:14 GMT -5
I think it might "need" the timer. On my machine, it speeds up & slows down depending on processor usage pretty noticeably. Here is my take on Carl's example with a few adjustments... 1. Make longer strings 2. Make the last letter white 3. Start them off the top of the window that way the entire window fills up Cool, but why is the last letter white?
|
|
|
Post by Carl Gundel on Dec 23, 2021 17:47:27 GMT -5
Okay, here is my slightly enhanced version. Bigger font. Bold bottom character.
nomainwin WindowWidth = 800 WindowHeight = 600 UpperLeftX = int((DisplayWidth-WindowWidth)/2) UpperLeftY = int((DisplayHeight-WindowHeight)/2) open "Matrix" for graphics_nsb as #1 #1 "down ; trapclose [quit]" s=250 dim s(s,3) for n= 1 to s #1 "font courier_new 14 " #1 "color black ; backcolor white" c=int(rnd(0)*65+65) c$ = chr$(c) #1 "place 0 14" #1 "\";c$;"\";c$;"\";c$ #1 "color 0 70 0 ; backcolor black" #1 "\";chr$(c) #1 "color darkgreen ; backcolor black" #1 "\";chr$(c) #1 "color green ; backcolor black" #1 "font courier_new 14 bold" #1 "\";chr$(c) #1 "getbmp b";n;" 1 1 10 120" #1 "addsprite s";n;" b";n s(n,1)=int(rnd(0)*60)*13 s(n,2)=int(rnd(0)*33)*18 s(n,3)=int(rnd(0)*20)+2 #1 "spritexy s";n;" ";s(n,1);" ";s(n,2) next #1 "fill black ; getbmp bac 0 0 800 600 ; background bac" #1 "drawsprites"
timer 100, [frame] wait
[frame] for n= 1 to s - 1 s(n,2)=s(n,2)+s(n,3)+1 if rnd(0)>.75 then if rnd(0)>.5 then #1 "spriteorient s";n;" mirror" else #1 "spriteorient s";n;" normal" if s(n,2)>600 then s(n,2)=s(n,2)=0-rnd(0)*100 #1 "spritexy s";n;" ";s(n,1);" ";10 * int(s(n,2) / 10) next #1 "drawsprites" wait
[quit] timer 0 close #1 end
|
|
|
Post by Brandon Parker on Dec 23, 2021 18:14:49 GMT -5
Carl, in the movies there is normally a character that appears super-bright at the point where the characters are popping onto the screen. I just chose to make the last one white to try and mimic that. This is not always the case, but it "needs" that, in my opinion, to look fairly close. In light of the leading character not always being bright, I have done this... Provides a chance that the string will be flipped as a Sprite. These strings will appear with the white letter at the top to try and provide the illusion that not all strings have white at the bottom. This also provides some interesting-looking characters because they are flipped or flipped & mirrored. Since humans are very pattern-based creatures, this should help to throw the brain off and trick it into "seeing" strange characters like in the movie. NoMainWin WindowWidth = DisplayWidth WindowHeight = DisplayHeight UpperLeftX = 0 UpperLeftY = 0 Open "The Matrix - Digital Rain" For Graphics_FS_NSB As #DigitalRain #DigitalRain "Down ; TrapClose quit" #DigitalRain "Font Bold Courier_New 14" s = 350 Dim s(s,3) Dim isFlipped(s) Dim c$(8) BackColor$ = "20 31 46"
For n = 1 To s #DigitalRain "Color Black ; BackColor White" For i = 0 To 8 c$(i) = Chr$(Int(rnd(0) * 223) + 33) Next i #DigitalRain "Place ";compoundIt;" 14" #DigitalRain "\";c$(0);"\";c$(1);"\";c$(2);"\";c$(3);"\";c$(4);"\";c$(5);"\";c$(6);"\";c$(7);"\";c$(8) #DigitalRain "Color Black; BackColor ";BackColor$;"; Place 0 195" #DigitalRain "BoxFilled 20 425" #DigitalRain "Place 0 215" For ii = 0 To 6 Step 3 #DigitalRain "Color 0 70 0" #DigitalRain "\";c$(ii) #DigitalRain "Color DarkGreen" #DigitalRain "\";c$(ii + 1) If ((ii = 6) And Abs(Not(n Mod 3))) Then color$ = "White" Else color$ = "Green" #DigitalRain "Color ";color$ #DigitalRain "\";c$(ii + 2) Next ii #DigitalRain "GetBMP b";n;" 1 1 10 390" '#DigitalRain "drawbmp b";n;" 25 25" #DigitalRain "Place 0 0; Color White; BackColor White; BoxFilled 20 425" #DigitalRain "AddSprite s";n;" b";n s(n,1) = (Rnd(0) * WindowWidth) s(n,2) = (Rnd(0) * WindowHeight * -1) s(n,3) = ((Rnd(0) * 20) + 2) isFlipped(n) = (Int((Rnd(0) * 100) + 1) > 50) #DigitalRain "SpriteXY s";n;" ";s(n,1);" ";s(n,2) Next n #DigitalRain "Fill ";BackColor$;"; GetBMP back 0 0 ";WindowWidth;" ";(WindowHeight + 50);"; Background back" #DigitalRain "DrawSprites"
While isWndOpen("#DigitalRain") Call frame s result = Sleep(50) Scan Wend End
'_________________________________________________________________________________________________________________________________________________________ '_________________________________________________________________________________________________________________________________________________________
Sub frame ByRef s For n = 1 To s s(n,2) = s(n,2) + s(n,3) + 1 If isFlipped(n) Then If (rnd(0) > 0.75) Then If (rnd(0) > 0.75) Then #DigitalRain "SpriteOrient s";n;" Flip" Else #DigitalRain "SpriteOrient s";n;" Rotate180" Else If (rnd(0) > 0.75) Then If (rnd(0) > 0.75) Then #DigitalRain "SpriteOrient s";n;" Mirror" Else #DigitalRain "SpriteOrient s";n;" Normal" End If If (s(n,2) > (WindowHeight + 50)) Then s(n,1) = (Rnd(0) * WindowWidth) : s(n,2) = (Rnd(0) * WindowHeight * -1) #DigitalRain "SpriteXY s";n;" ";s(n,1);" ";(10 * Int(s(n,2)/ 10)) Next n #DigitalRain "DrawSprites" End Sub
'_________________________________________________________________________________________________________________________________________________________ '_________________________________________________________________________________________________________________________________________________________
Sub quit handle$ Close #handle$ End End Sub
'_________________________________________________________________________________________________________________________________________________________ '_________________________________________________________________________________________________________________________________________________________
Function isWndOpen(handle$) On Error GoTo [Error] isWndOpen = Hwnd(#handle$) [Error] End Function
'_________________________________________________________________________________________________________________________________________________________ '_________________________________________________________________________________________________________________________________________________________
Function Sleep(milliseconds) CallDLL #kernel32, "Sleep", milliseconds As ulong, _ ret As void End Function Technically, we all have it wrong as the characters are not moving down the screen. They are popping onto the screen below the last in the chain and the oldest ones are fading away, but that is a challenge and this is close enough. EDIT: Another update: 1. Use DisplayWidth & DisplayHeight 2. Provide a new X location for the string to be in after it has traversed from top to bottom. This way, it prevents the same string from just rolling over in the same spot repeatedly. 3. Lower the number of White letters by using "n Mod 3" in their production 4. Changed the background color to resemble the screens in the movies {:0) Brandon Parker
|
|
|
Post by Brandon Parker on Dec 23, 2021 23:15:18 GMT -5
Now with approximately 50% of the strings being scaled from 75% - 100% to give it some perspective of depth...
And, a little change to how the letters get colored in a sequential string when they are created.
NoMainWin WindowWidth = DisplayWidth WindowHeight = DisplayHeight UpperLeftX = 0 UpperLeftY = 0 Open "The Matrix - Digital Rain" For Graphics_FS_NSB As #DigitalRain #DigitalRain "Down ; TrapClose quit" #DigitalRain "Font Bold Courier_New 14" s = 400 Dim s(s,3) Dim isFlipped(s) Dim isScaled(s) Dim c$(8) BackColor$ = "20 31 46"
For n = 1 To s #DigitalRain "Color Black ; BackColor White" For i = 0 To 8 c$(i) = Chr$(Int(rnd(0) * 223) + 33) Next i #DigitalRain "Place ";compoundIt;" 14" #DigitalRain "\";c$(0);"\";c$(1);"\";c$(2);"\";c$(3);"\";c$(4);"\";c$(5);"\";c$(6);"\";c$(7);"\";c$(8) #DigitalRain "Color Black; BackColor ";BackColor$;"; Place 0 195" #DigitalRain "BoxFilled 20 425" #DigitalRain "Place 0 215" greenNum = 70 For ii = 0 To 6 Step 3 #DigitalRain "Color 0 ";Int(greenNum + (23.125 * ii));" 0" #DigitalRain "\";c$(ii) #DigitalRain "Color 0 ";Int(greenNum + (23.125 * (ii + 1)));" 0" #DigitalRain "\";c$(ii + 1) If ((ii = 6) And Abs(Not(n Mod 3))) Then color$ = "White" Else color$ = "0 ";Int(greenNum + (23.125 * (ii + 2)));" 0" #DigitalRain "Color ";color$ #DigitalRain "\";c$(ii + 2) Next ii #DigitalRain "GetBMP b";n;" 1 1 10 390" '#DigitalRain "drawbmp b";n;" 25 25" #DigitalRain "Place 0 0; Color White; BackColor White; BoxFilled 20 425" #DigitalRain "AddSprite s";n;" b";n s(n,1) = (Rnd(0) * WindowWidth) s(n,2) = (Rnd(0) * WindowHeight * -1) s(n,3) = ((Rnd(0) * 20) + 2) isFlipped(n) = (Int((Rnd(0) * 100) + 1) > 50) isScaled(n) = (Int((Rnd(0) * 100) + 1) > 50) * (100 - Int((Rnd(0) * 25) + 1)) #DigitalRain "SpriteXY s";n;" ";s(n,1);" ";s(n,2) Next n #DigitalRain "Fill ";BackColor$;"; GetBMP back 0 0 ";WindowWidth;" ";WindowHeight;"; Background back" #DigitalRain "DrawSprites"
While isWndOpen("#DigitalRain") Call frame s result = Sleep(50) Scan Wend End
'_________________________________________________________________________________________________________________________________________________________ '_________________________________________________________________________________________________________________________________________________________
Sub frame ByRef s For n = 1 To s s(n,2) = s(n,2) + s(n,3) + 1 If isScaled(n) Then #DigitalRain "SpriteScale s";n;" ";isScaled(n) If isFlipped(n) Then If (rnd(0) > 0.75) Then If (rnd(0) > 0.75) Then #DigitalRain "SpriteOrient s";n;" Flip" Else #DigitalRain "SpriteOrient s";n;" Rotate180" Else If (rnd(0) > 0.75) Then If (rnd(0) > 0.75) Then #DigitalRain "SpriteOrient s";n;" Mirror" Else #DigitalRain "SpriteOrient s";n;" Normal" End If If (s(n,2) > WindowHeight ) Then s(n,1) = (Rnd(0) * WindowWidth) : s(n,2) = (Rnd(0) * WindowHeight * -1) #DigitalRain "SpriteXY s";n;" ";s(n,1);" ";(10 * Int(s(n,2)/ 10)) Next n #DigitalRain "DrawSprites" End Sub
'_________________________________________________________________________________________________________________________________________________________ '_________________________________________________________________________________________________________________________________________________________
Sub quit handle$ Close #handle$ End End Sub
'_________________________________________________________________________________________________________________________________________________________ '_________________________________________________________________________________________________________________________________________________________
Function isWndOpen(handle$) On Error GoTo [Error] isWndOpen = Hwnd(#handle$) [Error] End Function
'_________________________________________________________________________________________________________________________________________________________ '_________________________________________________________________________________________________________________________________________________________
Function Sleep(milliseconds) CallDLL #kernel32, "Sleep", milliseconds As ulong, _ ret As void End Function
{:0)
Brandon Parker
|
|
|
Post by klewlis on Dec 25, 2021 18:47:18 GMT -5
I knew I had done this years ago. I found this in my LB4.0.1 folder. Needs a little more work, but...
WindowWidth=1280
WindowHeight=1024
open "The Matrix has You" for graphics_nsb_nf as #M
print #M, "down ; fill black"
print #M, "backcolor black ; color green"
' print #M, "font gothicg 9 bold"
print #M, "font fixedsys 9 bold"
print #M, "trapclose [quit]"
[sloop]
x=(int((rnd(1)*52)+1))*24
yextent=(int((rnd(1)*54)+1))*18
hiextent=yextent
x1=(int((rnd(1)*52)+1))*24
yextent1=(int((rnd(1)*54)+1))*18
hiextent=max(hiextent,yextent1)
x2=(int((rnd(1)*52)+1))*24
yextent2=(int((rnd(1)*54)+1))*18
hiextent=max(hiextent,yextent2)
x3=(int((rnd(1)*52)+1))*24
yextent3=(int((rnd(1)*54)+1))*18
hiextent=max(hiextent,yextent3)
x4=(int((rnd(1)*52)+1))*24
yextent4=(int((rnd(1)*54)+1))*18
hiextent=max(hiextent,yextent4)
x5=(int((rnd(1)*52)+1))*24
yextent5=(int((rnd(1)*54)+1))*18
hiextent=max(hiextent,yextent5)
x6=(int((rnd(1)*52)+1))*24
yextent6=(int((rnd(1)*54)+1))*18
hiextent=max(hiextent,yextent6)
x7=(int((rnd(1)*52)+1))*24
yextent7=(int((rnd(1)*54)+1))*18
hiextent=max(hiextent,yextent7)
x8=(int((rnd(1)*52)+1))*24
yextent8=(int((rnd(1)*54)+1))*18
hiextent=max(hiextent,yextent8)
x9=(int((rnd(1)*52)+1))*24
yextent9=(int((rnd(1)*54)+1))*18
hiextent=max(hiextent,yextent9)
x10=(int((rnd(1)*52)+1))*24
yextent10=(int((rnd(1)*54)+1))*18
hiextent=max(hiextent,yextent10)
x11=(int((rnd(1)*52)+1))*24
yextent11=(int((rnd(1)*54)+1))*18
hiextent=max(hiextent,yextent11)
for y=10 to hiextent step 20
m$=chr$(int(rnd(1)*250)+1)
m1$=chr$(int(rnd(1)*250)+1)
m2$=chr$(int(rnd(1)*250)+1)
m3$=chr$(int(rnd(1)*250)+1)
m4$=chr$(int(rnd(1)*250)+1)
m5$=chr$(int(rnd(1)*250)+1)
m6$=chr$(int(rnd(1)*250)+1)
m7$=chr$(int(rnd(1)*250)+1)
m8$=chr$(int(rnd(1)*250)+1)
m9$=chr$(int(rnd(1)*250)+1)
m10$=chr$(int(rnd(1)*250)+1)
m11$=chr$(int(rnd(1)*250)+1)
print #M, "place ";x;" ";y
print #M, "color green"
print #M, "\";m$
if y<yextent1 then
print #M, "place ";x1;" ";y
print #M, "\";m1$
end if
if y<yextent2 then
print #M, "place ";x2;" ";y
print #M, "\";m2$
end if
if y<yextent3 then
print #M, "place ";x3;" ";y
print #M, "\";m3$
end if
if y<yextent4 then
print #M, "place ";x4;" ";y
print #M, "\";m4$
end if
if y<yextent5 then
print #M, "place ";x5;" ";y
print #M, "\";m5$
end if
if y<yextent6 then
print #M, "place ";x6;" ";y
print #M, "\";m6$
end if
if y<yextent7 then
print #M, "place ";x7;" ";y
print #M, "\";m7$
end if
if y<yextent8 then
print #M, "place ";x8;" ";y
print #M, "\";m8$
end if
if y<yextent9 then
print #M, "place ";x9;" ";y
print #M, "\";m9$
end if
if y<yextent10 then
print #M, "place ";x10;" ";y
print #M, "\";m10$
end if
if y<yextent11 then
print #M, "place ";x11;" ";y
print #M, "\";m11$
end if
timer 120, [change]
wait
[change]
timer 0
print #M, "place ";x;" ";y
print #M, "color darkgreen"
print #M, "\";m$
if y<yextent1 then
print #M, "place ";x1;" ";y
print #M, "\";m1$
end if
if y<yextent2 then
print #M, "place ";x2;" ";y
print #M, "\";m2$
end if
if y<yextent3 then
print #M, "place ";x3;" ";y
print #M, "\";m3$
end if
if y<yextent4 then
print #M, "place ";x4;" ";y
print #M, "\";m4$
end if
if y<yextent5 then
print #M, "place ";x5;" ";y
print #M, "\";m5$
end if
if y<yextent6 then
print #M, "place ";x6;" ";y
print #M, "\";m6$
end if
if y<yextent7 then
print #M, "place ";x7;" ";y
print #M, "\";m7$
end if
if y<yextent8 then
print #M, "place ";x8;" ";y
print #M, "\";m8$
end if
if y<yextent9 then
print #M, "place ";x9;" ";y
print #M, "\";m9$
end if
if y<yextent10 then
print #M, "place ";x10;" ";y
print #M, "\";m10$
end if
if y<yextent11 then
print #M, "place ";x11;" ";y
print #M, "\";m11$
end if
timer 25, [goOn]
wait
[goOn]
timer 0
next y
scan
goto [sloop]
wait
[quit]
timer 0
close #M
|
|
|
Post by klewlis on Dec 25, 2021 18:55:02 GMT -5
this was the first version in my folder, the other one I posted was the 3rd version
WindowWidth=640
WindowHeight=480
open "The Matrix has You" for graphics_nsb_nf as #M
print #M, "down ; fill black"
print #M, "backcolor black ; color green"
print #M, "font gothicg 9 bold"
print #M, "trapclose [quit]"
[sloop]
x=(int((rnd(1)*26)+1))*24
yextent=(int((rnd(1)*24)+1))*18
for y=10 to yextent step 20
m$=chr$(int(rnd(1)*250)+1)
print #M, "place ";x;" ";y
print #M, "color green"
print #M, "\";m$
timer 200, [change]
wait
[change]
timer 0
print #M, "place ";x;" ";y
print #M, "color darkgreen"
print #M, "\";m$
timer 25, [goOn]
wait
[goOn]
timer 0
next y
scan
goto [sloop]
wait
[quit]
timer 0
close #M
|
|
|
Post by tsh73 on Dec 26, 2021 4:51:02 GMT -5
I knew I had done this years ago. I found this in my LB4.0.1 folder. They call it "The Matrix Resurrections" Still cool after those years!
|
|
|
Post by Carl Gundel on Dec 29, 2021 9:22:11 GMT -5
Do you mind if I include a version of this with LB5?
|
|