home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 5 / amigaformatcd05.iso / readerstuff / richard_thompson / cool_stars! / examples / plot.amos / plot.amosSourceCode
Encoding:
AMOS Source Code  |  1996-08-13  |  624 b   |  27 lines

  1. 'This example shows how slow it would be to set up a starfield using 
  2. 'the AMOSPro Plot command. 
  3. '  
  4. 'THIS EXAMPLE USES NO COOL STARS! COMMANDS!! 
  5. '
  6. 'Notice how slow and jerky it is!! 
  7. '
  8. Screen Open 0,320,200,2,Lowres : Curs Off : Palette 0,$FFF
  9. Double Buffer : Autoback 0 : Hide 
  10. '
  11. 'Set up initial positions of each star.
  12. '
  13. Dim X(200),Y(200),XSPD(200)
  14. For I=1 To 200
  15.    X(I)=Rnd(319) : Y(I)=Rnd(199) : XSPD(I)=1+Rnd(3)
  16. Next I
  17. '
  18. 'A simple loop to clear, draw and update the stars!
  19. '
  20. Repeat 
  21.    Cls 0
  22.    For I=1 To 200
  23.       Plot X(I),Y(I)
  24.       Add X(I),XSPD(I),0 To 319
  25.    Next I
  26.    Screen Swap : Wait Vbl 
  27. Until Mouse Key