home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1993-06-16 | 1.8 KB | 101 lines |
- ' ---------------------------------
- '
- ' AMOSPro Compiler Example
- '
- ' Plottin' Stars Scroll
- '
- ' By Jean-Baptiste BOLCATO
- '
- ' (c) 1993 Europress Software Ltd.
- '
- ' ---------------------------------
- '
- ' --------------------------------------------
- ' Remark: A simple and clean star scroller
- '
- ' Average Acceleration: 300 %
- '
- ' Test configuration: A1200, 6Mb
- '
- ' Original AMOS Compiler: 250 %
- ' --------------------------------------------
-
- ' ---- Variables Init ----
-
- Dim X(512),Y(512),VX(512),N(6)
-
- ' Ntsc test
- YMAX=256+56*(Ntsc=True)
-
- ' Number of stars, timers
- N2=0 : N=1 : T=1
-
- ' Get random start positions for stars
- For I=1 To 512
- X(I)=Rnd(320)
- Y(I)=Rnd(248-56*(Ntsc=True))+8
- VX(I)=Rnd(4)+1
- Next I
-
- ' ---- Screen Init ----
-
- Screen Open 0,320,YMAX,2,Lowres
- Palette 0,$FFF : Cls 0 : Ink 1
- Curs Off : Hide
-
- ' ---- Main Loop ----
-
- ' switch OFF multitask
- Amos Lock : Break Off
- Dreg(0)=Execall(-132)
-
- Repeat
-
- CPT=0
-
- Repeat
-
- ' Add a star every 8 loops
- Inc N2 : If N2=8 : N2=0 : Inc N : End If
-
- Timer=0
-
- For I=1 To N
-
- ' A simple plot & unplot for the stars!
- Plot X(I),Y(I),0
- Add X(I),VX(I),0 To 319
- Plot X(I),Y(I),1
- Next I
-
- If Timer>T : Inc CPT : End If
-
- Until CPT>4
-
- ' Needs more than T VBLs to display N stars
- Bell : Home
- N(T)=N-1
- Print "< Needs";N(T);" stars to pass under";T;" VBL >"
- Inc T
-
- Until T=5
-
- ' --- Final Report ---
-
- ' Switch ON multitask
- Dreg(0)=Execall(-138)
- Amos Unlock : Break On
-
- Home
- Print " --- Final status report --- "
- Print
- For T=1 To 4
- Print "< Needs";N(T);" stars to pass under";T;" VBL >"
- Next T
- Print
- Print " Press mouse key to end"
- Repeat
- Multi Wait
- Until Mouse Key or(Inkey$<>"")
-
- End