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

  1. 'This example shows how you can create patterns with stars.  Experiment! 
  2. '
  3. 'This starfield is drawn 50 times/second, even if using a MC68000! 
  4. '  
  5. Screen Open 0,320,200,2,Lowres : Curs Off : Palette 0,$FFF
  6. Double Buffer : Autoback 0 : Hide 
  7. '  
  8.  Extension_17_001C 200,False : Rem Reserve 200 single coloured stars! 
  9. '
  10. 'Scatter initial positions of each star around centre of the screen! 
  11. '
  12. For I=1 To 200
  13.    Repeat 
  14.        Extension_17_003C I,152+Rnd(10),92+Rnd(10),-3+Rnd(6),-3+Rnd(6)
  15.    Until Extension_17_0174(I)<>0 and Extension_17_0188(I)<>0
  16. Next I
  17. '
  18. 'A simple loop to clear, draw and update the stars!
  19. '
  20. Repeat 
  21.     Extension_17_01D8 : Extension_17_01EA : Extension_17_0248 
  22.    Screen Swap : Wait Vbl 
  23. Until Mouse Key