home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
551-575
/
apd558
/
amoner2
/
gunner.amos
/
gunner.amosSourceCode
Wrap
AMOS Source Code
|
1993-11-29
|
7KB
|
307 lines
On Error Goto ERR_HANDLE
If Length(10)=0 Then Load "gunner.abk"
Global _STARTGAME
Dim TABLE(10),TABLE$(10)
For I=0 To 3
Read TABLE(I),TABLE$(I)
Next
Data 1000,"PAD",90,"HTD",80,"PHD",70,"SHM"
'HISCORE[200]
Screen Close 0
Unpack 6 To 1
Led Off
Music 1
Do
Palette 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
CHECKKEY
Fade 3,0,0,0,0,0,0,0,0,0,0,0,0,$FFF,0,0,0
CHECKKEY
Fade 3,0,0,0,0,0,0,0,0,0,0,0,0,$F00,$FFF,0,0
CHECKKEY
Fade 3,0,0,0,0,0,0,0,0,0,0,0,0,$F00,$F00,$FFF,0
CHECKKEY
Fade 3,0,0,0,0,0,0,0,0,0,0,0,0,$F00,$F00,$F00,$FFF
CHECKKEY
Fade 5,0,$111,$222,$333,$444,$555,$666,$777,$888,$999,$AAA,$BBB,$F00,$F00,$F00,$FFF
CHECKKEY
_SHISCORE
DY=-10 : Y=2*Y Hard(0)
Do
Screen Display 1,,Y/2,,
Add Y,DY : Add DY,1
Exit If Y>700
Wait Vbl
Loop
Screen Close 1
GAME[1]
If _STARTGAME
Music Off
GAME[0] : P=Param : HISCORE[P]
Music 1
Screen Close 1
Unpack 6 To 1
End If
Loop
Procedure GAME[DEMO]
_STARTGAME=0
Shared SCORE,NPLANES
'
If DEMO Then DEMOFUSE=200
'
Make Mask
NSHOTS=40
Screen Open 1,320,50,8,Lowres
Flash Off
Screen Display 1,,222,,
Curs Off
Screen Open 0,320,171,4,Lowres
Colour Back $5
Paper 0 : Pen 1 : Ink 1 : Flash Off : Curs Off : Cls 0
Get Sprite Palette
Dim X(NSHOTS),Y(NSHOTS),DX(NSHOTS),DY(NSHOTS),FUZ(NSHOTS)
Dim S(256),C(256)
Limit Mouse 0,0 To 255,0
'
Degree
For I=0 To 256
S(I)=220*Sin(I/1.42222)
C(I)=-220*Cos(I/1.42222)
Next
'
X=X Mouse
SCORE=0 : HP=5 : Ink 2
Draw 160,170 To 160+C(X)/40,170-S(X)/40
Plot 160+C(X)/4,170-S(X)/4
X(0)=0 : Y(0)=0
Set Bob 1,1,,
Bob Update Off
'
PLANEX=9999 : NPLANES=0
Do
If DEMO
Dec DEMOFUSE
If DEMOFUSE=0
Unpack 6 To 1
'Fade 5,0,$111,$222,$333,$444,$555,$666,$777,$888,$999,$AAA,$BBB,$F00,$F00,$F00,$FFF
Pop Proc
End If
End If
'
Exit If NPLANES>20
If PLANEX=9999
BM=0 : HP=5
If Rnd(5)=0
Inc NPLANES
SCOREUP
PLANEY=Rnd(120)
DPLANEX=Rnd(1)*6-3
If DPLANEX<0
ABASE=12
PLANEX=360
Else
ABASE=0
PLANEX=-100
End If
End If
Else
Add PLANEX,DPLANEX
If(PLANEX>400) or(PLANEX<-100)
PLANEX=9999 : DPLANEX=0
End If
End If
'
Add DI,1,0 To 1
If BM
Add IMAGE,DI
If IMAGE=13
IMAGE=9
End If
Else
Add IMAGE,DI,1 To 3
End If
Bob 1,PLANEX,PLANEY,ABASE+IMAGE
Bob Update
'
If DEMO=0
XM=X Mouse
MK=Mouse Key
Else
XM=Peek(DEMOFUSE+Start(10))
MK=-1
If Mouse Key
_STARTGAME=True
Pop Proc
End If
End If
If X<>XM
Ink 0
Draw 160,170 To 160+C(X)/40,170-S(X)/40
Plot 160+C(X)/4,170-S(X)/4
X=XM
Ink 2
Draw 160,170 To 160+C(X)/40,170-S(X)/40
Plot 160+C(X)/4,170-S(X)/4
End If
Add J,1,0 To 1
YN$=Inkey$ :
If YN$=Chr$(27)
Screen Close 1
Change Mouse 1
Show On
Limit Mouse
Default
Run "Autoexec.Amos"
End If
If MK
If DEMO=0
Shoot
End If
If J
Add II,1,0 To NSHOTS
Dec SCORE
SCOREUP
FUZ(II)=NSHOTS*2
X(II)=10240 : Y(II)=1
DX(II)=C(X+Rnd(1))
DY(II)=S(X+Rnd(1))
End If
End If
For I=0 To NSHOTS
Ink 0
X1=X(I) : Y1=Y(I) : Ror.l 6,X1 : Ror.l 6,Y1
If FUZ(I)
Plot X1 and 511,170-(Y1 and 511)
End If
Add X(I),DX(I)
Add Y(I),DY(I)
Add DY(I),-2
If FUZ(I)
Dec FUZ(I)
End If
Ink 3
X1=X(I) : Y1=Y(I) : Ror.l 6,X1 : Ror.l 6,Y1
If FUZ(I)
If(BM=0) and(Point(X1 and 511,170-(Y1 and 511))=1)
Dec HP
Add SCORE,20
SCOREUP
FUZ(I)=0
If HP=0
If DEMO=0
Boom
End If
BM=1 : IMAGE=3
Add SCORE,200
SCOREUP
End If
End If
Plot X1 and 511,170-(Y1 and 511)
End If
Next
'
Wait Vbl
Loop
Screen 1
Curs Off : Cls 0
Home : Print : Centre Border$("FINAL SCORE:"+Str$(SCORE),2)
Do
Exit If Inkey$<>""
Exit If Mouse Click
Exit If Fire(1)
Loop
End Proc[SCORE]
Procedure SCOREUP
Shared SCORE,NPLANES
Screen 1 : Home : Print
Centre " "+Str$(SCORE)+"/"+Str$(NPLANES)+" "
Screen 0
End Proc
Procedure CHECKKEY
For I=1 To 15
YN$=Inkey$
If YN$=Chr$(27)
Default
Run "Autoexec.Amos"
End If
If Mouse Key
Music Off
GAME[0] : P=Param : HISCORE[P]
Music 1
Screen Close 1
Unpack 6 To 1
'Fade 1,0,$111,$222,$333,$444,$555,$666,$777,$888,$999,$AAA,$BBB,$F00,$F00,$F00,$FFF
Pop Proc
End If
Wait 10
Next
End Proc
Procedure HISCORE[S]
Shared TABLE(),TABLE$()
If S<TABLE(9) Then Pop Proc
For I=0 To 9
Exit If TABLE(I)<S
Next
For J=9 To I+1 Step -1
TABLE(J)=TABLE(J-1)
TABLE$(J)=TABLE$(J-1)
Next
TABLE(I)=S
Screen Open 0,320,200,8,Lowres : Paper 0 : Pen 1 : Cls
Flash Off
Palette 0,0,0,0,0,0,0,0
Fade 10,0,$FFF,$F00,$F80,$FF0,$F0,$33F,$A0A
Data 1,2,3,3,4,4,5,5,6,7
Paper 6
Print : Centre Border$("Top Iraqis",2) : Paper 0
For J=0 To 9
Read P : Pen P
If J<>I
Locate 13,J*2+4
Print Using "######";TABLE(J);" ";TABLE$(J)
Else
PP=P
End If
Next
Locate 13,I*2+4 : Pen PP
Print Using "######";TABLE(I);" ";
Repeat : A$=Inkey$ : Until A$>" " : Print Upper$(A$);
Repeat : B$=Inkey$ : Until B$>" " : Print Upper$(B$);
Repeat : C$=Inkey$ : Until C$>" " : Print Upper$(C$);
TABLE$(I)=A$+B$+C$
DY=-10 : Y=2*Y Hard(0)
Do
Screen Display 0,,Y/2,,
Add Y,DY : Add DY,1
Exit If Y>700
Wait Vbl
Loop
Screen Close 0
End Proc
'
Procedure _SHISCORE
Shared TABLE(),TABLE$()
Screen Open 0,320,200,8,Lowres : Paper 0 : Pen 1 : Cls : Flash Off
Palette 0,0,0,0,0,0,0,0
Fade 10,0,$FFF,$F00,$F80,$FF0,$F0,$33F,$A0A
Data 1,2,3,3,4,4,5,5,6,7
Paper 6
Print : Centre Border$("Top Iraqis",2) : Paper 0
For J=0 To 9
Read P : Pen P
Locate 13,J*2+4
Print Using "######";TABLE(J);" ";TABLE$(J)
Next
CHECKKEY
DY=-10 : Y=2*Y Hard(0)
Do
Screen Display 0,,Y/2,,
Add Y,DY : Add DY,1
Exit If Y>700
Wait Vbl
Loop
Screen Close 0
End Proc
ERR_HANDLE:
Resume FINITO
FINITO:
Run "Autoexec.Amos"