TGC Codebase Backup



Starbounce by Anonymous Coder

18th Sep 2009 14:55
Summary

It's just a simple screensaver, just a ball that bouces on a starfield



Description

This can make a cute little screensaver for your system. It has two pieces of media, 1 bitmap and 1 wave file. The bitmap is a starfield i got off the internet, the wave file is a file i copied from the darkbasic media directory called and it's called "button".

Of course you can use any bitmap, i use the starfield because it covers the backdrop so smoothly. Once you get the program make an exe file and go to the dos prompt and rename it with a .scr extension, then copy it to the "c:\windows\system32" directory



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    rem
start:
 s=1
  load image "c:\stars.bmp",1
   load sound "c:\button.wav",1
    backdrop on
     hide mouse
      texture backdrop 1
       p=rnd(1):q=rnd(1)
        gosub randir
         x=0.01:y=0.01:z=50
          make object sphere 1,1
           scale object 1,150,150,150
            move object 1,z
             position object 1,x,y,z
              set sound volume 1,30
main:
 if p=0 then x=x+s
  if q=0 then y=y-s
   if p=1 then x=x-s
    if q=1 then y=y+s
     if y<-40 then play sound 1:q=1
      if y>20 then play sound 1:q=0
       if x>40 then play sound 1:p=1
        if x<-40 then play sound 1:p=0
         position object 1,x,y,z
          if spacekey()=1 then goto lvng
           goto main
randir:
 randomize p:randomize q
  return
lvng:
 cls
  show mouse
   end