home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / sourcecode / demos / 2dstars.amos / 2dstars.amosSourceCode next >
AMOS Source Code  |  1991-03-14  |  2KB  |  39 lines

  1. '
  2. '
  3. '
  4. Unpack 10 To 0 : Rem the starfield is really just colour cycling! 
  5. '
  6. '
  7. Hide 
  8. Shift Up 1,8,31,1 : Rem start the cycling
  9. Set Rainbow 0,0,16,"","","" : Rem set up my rainbows 
  10. For A=0 To 15
  11.    Rain(0,A)=15-A : Rem from $f (Bright Blue) to $0 (Black)
  12. Next 
  13. Rainbow 0,0,70,15
  14. Set Rainbow 1,0,16,"","",""
  15. For A=0 To 15
  16.    Rain(1,A)=A : Rem from black to bright blue
  17. Next 
  18. Rainbow 1,0,220,15 : Rem display the rainbow
  19. Colour 1,$F
  20. Ink 1,,
  21. Bar 0,0 To 352,50 : Rem draw 2 bars
  22. Bar 0,214 To 352,290 : Rem to mask the top & bottom of the screen 
  23. Screen Open 1,352,50,2,Lowres : Curs Off : Palette $F,$FFF
  24. Screen Display 1,112,265,, : Rem open & position a small screen 
  25. Hide : Rem turn off mousey
  26. TXT$="Stars! coded by Gaz......CopyLeft 1991        Too jerky for my liking, Amos just isnt fast enough to move a starfield at a decent speed, so I use colour cycling instead - and the overall effect is nearly the same....               "
  27. Def Scroll 1,0,0 To 352,200,-2,0 : Rem set a area to scroll 
  28. OFFSET=1
  29. Rem where to start getting the text from i.e. the 1st character
  30. Repeat 
  31.    Locate 41,0 : Rem position at the rightmost area of the scroll zone
  32.    Print Mid$(TXT$,OFFSET,1) : Rem print 1 character
  33.    Add OFFSET,1,1 To Len(TXT$) : Rem  this adds 1 to the variable OFFSET
  34.    For A=0 To 3 : Rem and resets it when it has become longer than the amount of chars in TXT$ 
  35.       Scroll 1 : Rem scroll our area 4 times (At a speed of 2. 4x2=8 Pixels Moved!)   
  36.       Wait Vbl : Rem wait for a vertical blank
  37.    Next 
  38. Until Mouse Click : Rem goto REPEAT command if no mouse click
  39. End