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

  1. 'Cool Stars! commands can be used to create snow and rain effects! 
  2. 'This example shows a nice snow scene. 
  3. '
  4. 'This starfield is drawn 50 times/second, even if using a MC68000! 
  5. '  
  6. Screen Open 0,320,200,2,Lowres : Curs Off : Palette $A,$FFF : Hide 
  7. '  
  8. 'Draw some snow on the ground! 
  9. 'Note that I've used Draw to draw the snow instead of Plot.  If I use
  10. 'Plot, the program works fine uncompiled but won't work properly when
  11. 'compiled!  Looks like another compiler bug (-*NOT*- a Cool Stars! bug!).  
  12. '
  13. Degree 
  14. For X=0 To 319
  15.    Y=180+(Sin(X)*5) : Draw X,Y To X,Y
  16. Next X
  17. Paint 0,199
  18. Double Buffer : Autoback 0
  19. '
  20.  Extension_17_001C 200,False : Rem Reserve 200 single coloured stars! 
  21. '
  22. 'Set up initial positions of each star (well, snowflake in this case!).  
  23. '
  24. For I=1 To 200
  25.     Extension_17_003C I,Rnd(319),Rnd(199),1+Rnd(2),1+Rnd(2)
  26. Next I
  27. '
  28. 'A simple loop to clear, draw and update the stars (snowflakes)! 
  29. 'Note that I use Cstars Bclear and Cstars Bdraw to save the background.
  30. 'If not, the snow on the ground would get corrupted! 
  31. '
  32. Repeat 
  33.     Extension_17_020E : Extension_17_0222 : Extension_17_0248 
  34.    Screen Swap : Wait Vbl 
  35. Until Mouse Key