Rem Dark Basic Classic Project:
Rem Created: 5/4/2007 2:59:47 AM
Rem Title: starfield
Rem Author: Phaelax
 
 
total = 400
rem x,y,angle,speed
dim stars#(total, 4)
for i = 1 to total
   stars#(i,1) = screen width()/2 + rnd(20)-10
   stars#(i,2) = screen height()/2 + rnd(20)-10
   stars#(i,3) = rnd(360)
   stars#(i,4) = (rnd(60)+10)/10.0
next i
 
width2 = screen width()/2
height2 = screen height()/2
 
hide mouse
sync on
 
ink rgb(255,255,255),0
 
repeat
   cls
 
   for i = 1 to total
      if stars#(i,1) < 0 or stars#(i,1) > screen width() or stars#(i,2) < 0 or stars#(i,2) > screen height()
         stars#(i,1) = width2
         stars#(i,2) = height2
         stars#(i,3) = rnd(360)
         stars#(i,4) = rnd(5)+1
      else
         stars#(i,1) = stars#(i,1)+sin(stars#(i,3))*stars#(i,4)
         stars#(i,2) = stars#(i,2)+cos(stars#(i,3))*stars#(i,4)
      endif
      dot stars#(i,1),stars#(i,2)
   next i
 
   sync
until breaker() = 1
end
 
 
function breaker()
   if mousemovex() <> 0 then exitfunction 1
   if mousemovey() <> 0 then exitfunction 1
   if mousemovez() <> 0 then exitfunction 1
   if mouseclick() <> 0 then exitfunction 1
   if scancode() <> 0 then exitfunction 1
endfunction 0