home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1996-08-13 | 1.1 KB | 35 lines |
- 'Cool Stars! commands can be used to create snow and rain effects!
- 'This example shows a nice snow scene.
- '
- 'This starfield is drawn 50 times/second, even if using a MC68000!
- '
- Screen Open 0,320,200,2,Lowres : Curs Off : Palette $A,$FFF : Hide
- '
- 'Draw some snow on the ground!
- 'Note that I've used Draw to draw the snow instead of Plot. If I use
- 'Plot, the program works fine uncompiled but won't work properly when
- 'compiled! Looks like another compiler bug (-*NOT*- a Cool Stars! bug!).
- '
- Degree
- For X=0 To 319
- Y=180+(Sin(X)*5) : Draw X,Y To X,Y
- Next X
- Paint 0,199
- Double Buffer : Autoback 0
- '
- Extension_17_001C 200,False : Rem Reserve 200 single coloured stars!
- '
- 'Set up initial positions of each star (well, snowflake in this case!).
- '
- For I=1 To 200
- Extension_17_003C I,Rnd(319),Rnd(199),1+Rnd(2),1+Rnd(2)
- Next I
- '
- 'A simple loop to clear, draw and update the stars (snowflakes)!
- 'Note that I use Cstars Bclear and Cstars Bdraw to save the background.
- 'If not, the snow on the ground would get corrupted!
- '
- Repeat
- Extension_17_020E : Extension_17_0222 : Extension_17_0248
- Screen Swap : Wait Vbl
- Until Mouse Key