Posted: 9th Sep 2003 22:57
Here's my take on Microsoft's bouncing lines screen saver. Written in around 10 minutes.
Posted: 9th Sep 2003 23:00
I like it
Posted: 9th Sep 2003 23:03
This version will make your eyes boggle a bit.
Posted: 10th Sep 2003 0:20
I'll be able to test it tommorrow.... when I have DBPro! Mwahahahaha!

(This must be the third post that I mentioned this (monster!))
Posted: 10th Sep 2003 12:10
Indeed...

Glad you like it David. I want to add a rotating background later...
Posted: 10th Sep 2003 13:46
Dont try the second version - I need to repost it. For some reason a few lines were lost...
Posted: 10th Sep 2003 14:23
Heres a more interesting version.

I'll try putting it here, seeing as it's still being messed up in the source module window.

+ Code Snippet
Rem Project: Lines
Rem Created: 09/09/2003 19:36:22

Rem ***** Main Source File *****
SYNC On
SYNC RATE 0
#constant MAXLINES   4*4

type lines
   x as float
   y as float
   dx as float
   dy as float
   r as integer
   g as integer
   b as integer
endtype

dim l(MAXLINES) as lines

randomize timer()
for x=1 to MAXLINES
   l(x).x=rnd(screen width()>>1)*1.0
   l(x).y=rnd(screen height()>>1)*1.0
   l(x).dx=(rnd(4)+1)*0.5
   l(x).dy=(rnd(4)+1)*0.5
   l(x).r=rnd(254)+1
   l(x).g=rnd(254)+1
   l(x).b=rnd(254)+1
next x

cls 0
print "Please Wait"
sync
sync

screenWidth=screen width()
screenHeight=screen height()

bmSize=screenWidth*5
create bitmap 1,bmSize,bmSize
set current bitmap 1
for x=0 to bmSize step 8
   for y=0 to bmSize step 8
      box x,y,x+8,y+8,_
         rgb(rnd(64),rnd(64),rnd(64)),_
         rgb(rnd(64),rnd(64),rnd(64)),_
         rgb(rnd(64),rnd(64),rnd(64)),_
         rgb(rnd(64),rnd(64),rnd(64))
   next y
next x
get image 1,0,0,bmSize-1,bmSize-1
set current bitmap 0

draw sprites first
sprite 1,screenWidth>>1,screenWidth>>1,1
offset sprite 1,bmSize>>1,bmSize>>1
angle#=0.0
do
   rotate sprite 1,angle#
   inc angle#,0.5
   for x=1 to MAXLINES
      ink rgb(l(x).r,l(x).g,l(x).b),0
      if x<MAXLINES
         line l(x).x,l(x).y,l(x+1).x,l(x+1).y
      else
         line l(x).x,l(x).y,l(1).x,l(1).y
      endif

      inc l(x).x,l(x).dx
      if l(x).x<0
         l(x).x=0
         l(x).dx=-l(x).dx
         if rnd(100)<50
            l(x).dx=(rnd(4)+1)*0.5
         endif
         l(x).r=(l(x).r+1) && 255
         l(x).g=(l(x).g+1) && 255
         l(x).b=(l(x).b+1) && 255
      else
         if l(x).x>screenWidth-1
            l(x).x=screenWidth-1
            l(x).dx=-l(x).dx
            if rnd(100)>75
               l(x).dx=(rnd(4)+1)*0.5
            endif
            l(x).r=(l(x).r+1) && 255
            l(x).g=(l(x).g+1) && 255
            l(x).b=(l(x).b+1) && 255
         endif
      endif

      inc l(x).y,l(x).dy
      if l(x).y<0
         l(x).y=0
         l(x).dy=-l(x).dy
         if rnd(100)>40
            l(x).dx=(rnd(4)+1)*0.5
         endif
         l(x).r=(l(x).r+1) && 255
         l(x).g=(l(x).g+1) && 255
         l(x).b=(l(x).b+1) && 255
      else
         if l(x).y>screenHeight-1
            l(x).y=screenHeight-1
            l(x).dy=-l(x).dy
            if rnd(100)<30
               l(x).dy=(rnd(4)+1)*0.5
            endif
         endif
         l(x).r=(l(x).r+1) && 255
         l(x).g=(l(x).g+1) && 255
         l(x).b=(l(x).b+1) && 255
      endif
   next x
   sync
   repeat
   until spacekey()=0
loop
Posted: 11th Sep 2003 12:45
If that wasn't enough to cause you to visit the bathroom, get a load of this one.

+ Code Snippet
Rem Project: Lines
Rem Created: 09/09/2003 19:36:22

Rem ***** Main Source File *****
SYNC On
SYNC RATE 0

#constant MAXLINES   4*4
#constant MAXDOTS    128

screenWidth=screen width()
screenHeight=screen height()

type lines
   x as float
   y as float
   dx as float
   dy as float
   r as integer
   g as integer
   b as integer
endtype

type dots
   x as float
   y as float
   dy as float
   dx as float
endtype

dim l(MAXLINES) as lines
dim d(MAXDOTS) as dots

for x=1 to MAXDOTS
   d(x).x=0.0
   d(x).y=0.0
   d(x).dy=0.0
next x

randomize timer()
for x=1 to MAXLINES
   l(x).x=rnd(screenWidth>>1)*1.0
   l(x).y=rnd(screenHeight>>1)*1.0
   l(x).dx=(rnd(4)+1)*0.5
   l(x).dy=(rnd(4)+1)*0.5
   l(x).r=rnd(254)+1
   l(x).g=rnd(254)+1
   l(x).b=rnd(254)+1
next x

cls 0
print "Please Wait"
sync
sync

bmSize=screenWidth*2
create bitmap 1,bmSize,bmSize
set current bitmap 1
for x=0 to bmSize step 8
   for y=0 to bmSize step 8
      box x,y,x+8,y+8,_
         rgb(rnd(64),rnd(64),rnd(64)),_
         rgb(rnd(64),rnd(64),rnd(64)),_
         rgb(rnd(64),rnd(64),rnd(64)),_
         rgb(rnd(64),rnd(64),rnd(64))
   next y
next x
get image 1,0,0,bmSize-1,bmSize-1,1
set current bitmap 0

draw sprites first
sprite 1,screenWidth>>1,screenHeight>>1,1
offset sprite 1,bmSize>>1,bmSize>>1
angle#=0.0
dotColour=rgb(rnd(256-32)+32,rnd(256-32)+32,rnd(256-32)+32)
count=0
dir#=0.5
loopc=0
sa#=0.0
cls 0
sync
do
   sprite 1,(screenWidth>>1)+(256*sin(sa#)),(screenHeight>>1)+(256*cos(sa#)),1
   rotate sprite 1,angle#
   sa#=wrapvalue(sa#+1.0)
   angle#=wrapvalue(angle#+dir#)
   for x=1 to MAXLINES
      ink rgb(l(x).r,l(x).g,l(x).b),0
      if x<MAXLINES
         line l(x).x,l(x).y,l(x+1).x,l(x+1).y
      else
         line l(x).x,l(x).y,l(1).x,l(1).y
      endif

      inc l(x).x,l(x).dx
      if l(x).x<0
         l(x).x=0
         l(x).dx=-l(x).dx
         if rnd(100)<50
            l(x).dx=(rnd(4)+1)*0.5
         endif
         l(x).r=(l(x).r+1) && 255
         l(x).g=(l(x).g+1) && 255
         l(x).b=(l(x).b+1) && 255
      else
         if l(x).x>screenWidth-1
            l(x).x=screenWidth-1
            l(x).dx=-l(x).dx
            if rnd(100)>75
               l(x).dx=(rnd(4)+1)*0.5
            endif
            l(x).r=(l(x).r+1) && 255
            l(x).g=(l(x).g+1) && 255
            l(x).b=(l(x).b+1) && 255
         endif
      endif

      inc l(x).y,l(x).dy
      if l(x).y<0
         l(x).y=0
         l(x).dy=-l(x).dy
         if rnd(100)>40
            l(x).dx=(rnd(4)+1)*0.5
         endif
         l(x).r=(l(x).r+1) && 255
         l(x).g=(l(x).g+1) && 255
         l(x).b=(l(x).b+1) && 255
      else
         if l(x).y>screenHeight-1
            l(x).y=screenHeight-1
            l(x).dy=-l(x).dy
            if rnd(100)<30
               l(x).dy=(rnd(4)+1)*0.5
            endif
         endif
         l(x).r=(l(x).r+1) && 255
         l(x).g=(l(x).g+1) && 255
         l(x).b=(l(x).b+1) && 255
      endif
   next x

   for index=1 to MAXDOTS
      if d(index).x>0.0
         ink dotColour,0
         box d(index).x,d(index).y,d(index).x+2,d(index).y+2
         inc d(index).y,d(index).dy
         inc d(index).x,d(index).dx
         if d(index).y>screenHeight or d(index).x>screenWidth
            d(index).x=0.0
            d(index).y=0.0
         endif
      else
         if rnd(10)<3
            d(index).x=rnd(screenWidth)*1.0
            d(index).y=0.0
            d(index).dy=(rnd(5)+1)*1.0
            d(index).dx=((rnd(5)-1)*1.0)+0.5
         endif
      endif
   next index
   repeat
   until spacekey()=0

   inc count
   if count>screenHeight*4
      dotColour=rgb(rnd(256-32)+32,rnd(256-32)+32,rnd(256-32)+32)
      count=0
   endif
   if loopc>2000
      loopc=0
      dir#=0.0-dir#
      if dir#>0.0
         inc dir#,0.5
         if dir#>5.0
            dir#=0.5
         endif
      endif
   else
      inc loopc
   endif
   text 0,0,"FPS:"+str$(screen fps())+" Speed:"+str$(dir#)+" Angle #2:"+str$(sa#)
   sync
loop
Posted: 16th Sep 2003 7:38
Here's one I made some time ago. You can specify the number of points, number of lines, line spacing, etc.
Posted: 16th Sep 2003 8:03
do u guys remember the game qix? hehe ahh that was a cool game
Posted: 16th Sep 2003 12:42
Never really liked it that much.
Posted: 17th Sep 2003 22:31
qix? Is that like trix on Amiga?
lines bounce around and you try to fill the screen
Posted: 18th Sep 2003 5:14
yes but qix was first
Posted: 19th Sep 2003 11:00
I was thinking (very briefly) that this may have been a good coding challenge. Then I thought against it as it's 2D and the maths may have slowed things down.
Posted: 26th Sep 2003 8:25
I did the same thing about a month back lol. Its fun to figure out. Mine was rainbowy. Once I find the code I'll post it, it wasnt nearly as long coded as yours tho.
Posted: 26th Sep 2003 12:33
I've modified it for the Convention so it can play any one of 7 MOD tunes I've got, and scrolling text along the bottom.
Posted: 3rd Oct 2003 5:42
AHHHHH I remember QIX!!!

Anyways, I hate DBPro, none of these work for me.
Posted: 5th Oct 2003 7:37
hehe

I made something like this a while ago. I think it was like the first thing I posted.

+ Code Snippet
speed# = 2.0:polys = 2:lines = 3:space = 5
Randomize timer()
ink RGB(rnd(255)+1,rnd(255)+1,rnd(255)+1),RGB(0,0,0)
Dim direction(polys,8): Dim points#(polys,8)
For n = 1 To polys: For x = 1 To 4
points#(n,x) = rnd(screen width()):points#(n,x+4) = rnd(screen height())
direction(n,x) = rnd(2)+1: If direction(n,x) = 2 Then direction(n,x) = -1: direction(n,x+4) = rnd(2)+1: If direction(n,x+4)= 2 Then direction(n,x+4)=-1
Next x: Next n:r=255:Do
If r = 255 and b = 0 Then inc g
If r = 255 and b > 0 Then dec b
If g = 255 and r > 0 Then dec r
If r = 0 and b<255 Then inc b
If b = 255 and r=0 and g>0 Then dec g
If g=0 and b =255 Then inc r
ink RGB(r,g,b),RGB(0,0,0): For n = 1 To polys: For x = 1 To 4: points#(n,x) = points#(n,x) + direction(n,x)*speed#: points#(n,x+4) = points#(n,x+4) + direction(n,x+4)*speed#
If points#(n,x) > screen width() or points#(n,x) < 1 Then direction(n,x) = direction(n,x)* -1
If points#(n,x+4) > screen height() or points#(n,x+4) < 1 Then direction(n,x+4) = direction(n,x+4) * -1
Next x: Next n: For n = 1 To polys: For x = 1 To lines
Line points#(n,1)+space*x,points#(n,5),points#(n,2)+space*x,points#(n,6): Line points#(n,2)+space*x,points#(n,6),points#(n,3)+space*x,points#(n,7): Line points#(n,3)+space*x,points#(n,7),points#(n,4)+space*x,points#(n,8): Line points#(n,4)+space*x,points#(n,8),points#(n,1)+space*x,points#(n,5)
Next x: Next n:Loop
Posted: 6th Oct 2003 1:35
Not bad...
Posted: 6th Oct 2003 2:31
BouncingLines is now availiable from my web site - complete with 7 tunes.