home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1996-08-13 | 1.0 KB | 41 lines |
- 'This example shows how you can use Cstars Bclear and Cstars Bdraw to
- 'make stars fly through graphics without corrupting them. Here, I've
- 'used some circles as the graphic but remember that the graphic can be
- '-*ANYTHING*-, a logo, scrolltext, high score table or whatever!
- '
- 'This starfield is drawn 50 times/second, even if using a MC68000!
- '
- Screen Open 0,320,200,16,Lowres : Flash Off : Curs Off : Cls 0 : Palette 0,$FFF
- Hide
- '
- 'Calculate palette!
- '
- For I=2 To 15
- Colour I,256*I+16*I+I
- Next I
- '
- 'Draw some circles!
- '
- For I=1 To 50
- Ink I mod 16
- Circle 160,100,I
- Next I
- '
- Double Buffer : Autoback 0
- '
- Extension_17_001C 200,False : Rem Reserve 200 single coloured stars!
- '
- 'Set up initial positions of each star.
- '
- For I=1 To 200
- Repeat
- Extension_17_003C I,Rnd(319),Rnd(199),-5+Rnd(10),-5+Rnd(10)
- Until Extension_17_0174(I)<>0 or Extension_17_0188(I)<>0
- Next I
- '
- 'A simple loop to clear, draw and update the stars!
- '
- Repeat
- Extension_17_020E : Extension_17_0222 : Extension_17_0248
- Screen Swap : Wait Vbl
- Until Mouse Key