home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1996-08-13 | 1.0 KB | 30 lines |
- 'This example demonstrates how you can set up a multicoloured starfield.
- 'In this example, stars that are flying faster are given brighter colours.
- 'Stars which are flying slower are given darker colours. This gives a
- 'rather cool parallax effect! This example requires the registered version
- 'of Cool Stars! to run!
- '
- 'This starfield is drawn 50 times/second, even if using a MC68000!
- '
- Screen Open 0,320,150,4,Lowres : Flash Off : Curs Off : Cls 0
- Palette 0,$FFF,$BBB,$777 : Screen Display 0,,75,,
- Double Buffer : Autoback 0 : Hide
- '
- Extension_17_001C 130,True : Rem Reserve 130 multicoloured stars!
- '
- 'Set up initial positions of each star.
- '
- For I=1 To 130
- SPD=1+Rnd(4)
- Extension_17_003C I,Rnd(319),Rnd(149),SPD,0
- If SPD=1 or SPD=2 : Extension_17_0092 I,3 : End If
- If SPD=3 or SPD=4 : Extension_17_0092 I,2 : End If
- If SPD=5 : Extension_17_0092 I,1 : End If
- Next I
- '
- 'A simple loop to clear, draw and update the stars!
- '
- Repeat
- Extension_17_01D8 : Extension_17_01EA : Extension_17_0248
- Screen Swap : Wait Vbl
- Until Mouse Key