home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
376-400
/
apd385
/
rattlesnake.amos
/
rattlesnake.amosSourceCode
Wrap
AMOS Source Code
|
1991-06-13
|
18KB
|
828 lines
'
'
' R a t t l e S n a k e
' -----------------------
'
' Odyssey Software 1992
'
' Written by Ben Ashley
' Graphics by Ben Ashley
' Sound by Ben Ashley
'
'
A#=0.0
On Error Goto HELP
Screen Open 0,320,256,32,Lowres
Colour 1,$FFF : Pen 1 : Paper 0
Curs Off : Flash Off : Hide On : Cls 0
Load "Sound/Startsamp.Abk"
Load "Graphics/Bigsprites.Abk" : Double Buffer
Get Sprite Palette
Cls 0
I=2
Sam Loop On
Sam Play 1,1,15000
For F=250 To 50 Step -1
Bob 1,0,F,1
Bob 2,0,F-22,I
If I=2
I=3
Else
I=2
End If
Wait 3
Next F
For F=1 To 30
Bob 2,0,Y Bob(2),I
If I=2
I=3
Else
I=2
End If
Wait 3
Next F
J=250
For F=-100 To 40
Bob 3,20,F,4
Bob 4,20,J,5
Add J,-1
Bob 2,0,Y Bob(2),I
If I=2
I=3
Else
I=2
End If
Wait 3
Next F
For F=1 To 35
Bob 2,0,Y Bob(2),I
If I=2
I=3
Else
I=2
End If
Wait 3
Next F
Fade 3 : Wait 15*3
Erase 1
Erase 5
Sam Loop Off
Screen Close 0
'
Dim F(2),S(2),D(2),X(2),Y(2),A(2),SH(2)
Dim K(2)
'
Global K(),F(),S(),D(),X(),Y(),A(),SH()
'
NUMBER=1
DEAD=False
B1$="Off" : WIND=0
B2$=" On" : BK=1
B3$=" On" : SND=1
'
F(1)=3
F(2)=15
'
X(1)=0 : X(2)=295
Y(1)=15 : Y(2)=221
I1=25
COMP=0
PL1$="Brad"
PL2$="Beau"
'
If Not Exist("Hi-snake.Dat")
Open Out 1,"Hi-Snake.Dat"
Print #1,"Ben Ashley"
Print #1,"3"
Print #1,"4"
Close 1
Else
Open In 1,"Hi-Snake.Dat"
Input #1,N$
Input #1,NA$
Input #1,OF$
HI=Val(NA$)
OF=Val(OF$)
Close 1
End If
Do
Show On
Screen Open 0,640,240,8,Hires
Cls 0
Curs Off : Flash Off : Cls 0
Do
Colour 1,$FFF
Colour 2,$F00
Colour 3,$FF0
Colour 4,$F0
Colour 5,$666
Colour 6,$800
Colour 7,$F
Pen 1 : Paper 2
Centre At(,2)+"Rattle Snake"
Centre At(,3)+"************"
Pen 0 : Paper 3
Centre At(,5)+"Written by Ben Ashley, 1992"
Pen 1 : Paper 0
'
X1$="Enter player names"
X2$="View Best Player"
X3$="Options"
X4$="Start Game"
X5$="Quit"
Paper 7
Reserve Zone 8
Print At(20,9);Zone$(X1$,1)
Print At(20,11);Zone$(X2$,2)
Print At(20,13);Zone$(X3$,3)
Print At(20,15);Zone$(X4$,4)
Print At(20,17);Zone$(X5$,5)
Repeat
M=Mouse Zone
Until Mouse Key<>0
If M<>0
Cls 0
End If
If M=1
Pen 1 : Paper 2
Centre At(,1)+"Enter Player names"
Centre At(,2)+"******************"
Paper 0
Locate 10,3
Input "Player 1:";PL1$
Locate 10,5
Input "Player 2:";PL2$
Cls 0
Curs Off
End If
If M=2
Pen 1 : Paper 2
Centre At(,1)+"****************"
Centre At(,2)+"The BEST Player!"
Centre At(,3)+"****************"
Paper 0
Centre At(,5)+"I S"
Paper 7
Centre At(,8)+N$
Paper 0
Centre At(,10)+"with"
Pen 0 : Paper 3
Centre At(,12)+Str$(HI)-" "+" kills out of"+Str$(OF)+" Games."
Repeat
Until Mouse Key<>0
Cls 0
End If
If M=3
Do
Pen 1 : Paper 2
Centre At(,1)+"Game Options"
Centre At(,2)+"************"
X1$="Wind Effects "
X2$="Background GFX "
X3$="Sound FX "
X4$="Number of fights "
X5$="<" : X6$=">"
Paper 7
Locate 20,5
Print Zone$(X1$,1);
Paper 0 : Print B1$
Paper 7
Locate 20,7
Print Zone$(X2$,2);
Paper 0 : Print B2$
Paper 7
Locate 20,9
Print Zone$(X3$,3);
Paper 0 : Print B3$
Paper 7
Locate 20,11
Print X4$+Paper$(3)+Pen$(0)+Zone$(X5$,5)+Paper$(7)+" "+Paper$(3)+Zone$(X6$,6)+Paper$(0)+Pen$(1)+Str$(NUMBER)+" "
Pen 1
Paper 7
Locate 20,13
Print Zone$("Quit ",4)
Repeat
M2=Mouse Zone
Wait 3
Until Mouse Key<>0
If M2=1
If B1$="Off"
B1$=" On"
WIND=1
Else
B1$="Off"
WIND=0
End If
End If
If M2=2
If B2$="Off"
B2$=" On"
BK=1
Else
B2$="Off"
BK=0
End If
End If
If M2=3
If B3$="Off"
B3$=" On"
SND=1
Else
B3$="Off"
SND=0
End If
End If
If M2=5
Add NUMBER,-1
If NUMBER<1
NUMBER=1
End If
End If
If M2=6
Add NUMBER,1
End If
If M2=4
Goto EN
End If
Loop
EN:
Cls 0
End If
If M=4
Exit
End If
If M=5
Edit
End If
Loop
'
Hide On
Screen Open 0,320,256,32,Lowres
Pen 1 : Paper 0 : Ink 1,0
Curs Off : Flash Off
Cls 0
'
Load "Graphics/Sprites.Abk"
If SND=1
Load "Sound/Samples.Abk"
End If
'
Get Sprite Palette
'
Cls 0
Screen Hide
If BK=1
Ink 13,0
Plot 5,5
Plot 4,6 : Plot 6,6
Plot 3,7 : Plot 5,7 : Plot 7,7
Plot 4,8 : Plot 6,8 : Plot 8,8
Get Bob 38,2,2 To 7,10
Cls 0
Plot 5,5
Get Bob 39,4,4 To 6,6
Cls 0
Circle 5,5,4
Get Bob 40,0,0 To 10,10
Cls 0
Draw 4,4 To 5,4
Get Bob 41,3,3 To 6,5
Cls 0
Ink 12,0
Bar 5,5 To 30,8
Ink 11,0
For F=5 To 30 Step 6
Draw F,5 To F,8
Next F
Get Bob 42,4,4 To 31,9
End If
Screen Show
Cls 0
For GAME=1 To NUMBER
Load "Graphics/Back.Abk"
Unpack 6 To 0
Double Buffer
Erase 6
Screen Open 1,640,15,4,Hires
Curs Off : Flash Off : Cls 0
Colour 1,$FFF : Colour 2,$666 : Colour 3,$555
Pen 1 : Paper 0
Screen Display 1,130,40,640,15
Ink 2,
Box 0,0 To 639,14
Ink 3,
Box 1,1 To 638,13
Ink 1,0
Screen To Front 1
Screen 0
'
WINDPOWER=Rnd(5)
'
Bob 25,X(1),Y(1),F(1)
Bob 26,X(2),Y(2),F(2)
Bob 27,X(1),Y(1),I1
Bob 28,X(2),Y(2),I1
'
'
Repeat
Until Inkey$=" " or Fire(1)
'
TIME=0 : BONUSTIME=Rnd(1000)
TIME2=0
SH1T=0 : SH2T=0
'
CX=-20 : TX=350
CX2=340
'
Repeat
Add TIME,1
Add TIME2,1
Bob 25,X(1),Y(1),F(1)
Bob 26,X(2),Y(2),F(2)
Bob 27,X(1),Y(1),I1
Bob 28,X(2),Y(2),I1
Bob 0,X(1)-6,Y(1)+150,38
Bob 1,X(2)-6,Y(2)+150,38
If WIND=1
If TIME2>300 and TIME<800
D=Rnd(3)
If D=0
X(1)=X(1)-WINDPOWER
X(2)=X(2)-WINDPOWER
If B=1
Bob 60,X Bob(60)-WINDPOWER,,
End If
End If
If D=1
X(1)=X(1)+WINDPOWER
X(2)=X(2)+WINDPOWER
If B=1
Bob 60,X Bob(60)+WINDPOWER,,
End If
End If
If D=2
Y(1)=Y(1)-WINDPOWER
Y(2)=Y(2)-WINDPOWER
End If
If D=3
Y(1)=Y(1)+WINDPOWER
Y(2)=Y(2)+WINDPOWER
End If
End If
If TIME2>800
TIME2=0
WINDPOWER=Rnd(4)
End If
End If
If BK=1
Bob 2,CX,29,41
Bob 3,TX,232,42
Bob 4,CX2,31,41
Add CX,1
Add CX2,-1
Add TX,-1
If CX>350
CX=-20
End If
If TX<-30
TX=350
End If
If CX2<-15
CX2=340
End If
End If
If SH(1)=1
Bob 31,X(1),Y(1),27
Bob 5,X(1)-8,Y(1)+150,40
Add SH1T,1
End If
If SH(2)=1
Bob 32,X(2),Y(2),27
Bob 6,X(2)-8,Y(2)+150,40
Add SH2T,1
End If
If SH1T>500
SH1T=0
SH(1)=0
Bob Off 31
Bob Off 5
End If
If SH2T>500
SH2T=0
SH(2)=0
Bob Off 32
Bob Off 6
End If
If TIME=BONUSTIME
B=1
Bob 60,Rnd(270),-50,35
End If
If B=1
Bob 60,X Bob(60),Y Bob(60)+1,35
End If
If B=1
If Y Bob(60)>230
B=0
TIME=0
BONUSTIME=Rnd(2000)
Bob Off 60
End If
End If
'
If I1=25
I1=26
Else
I1=25
End If
Wait Vbl
'
If Jup(1)
Add SP1,1
If SP1>3
SP1=3
End If
End If
If COMP=0
If Key State(76)
Add SP2,1
If SP2>3
SP2=3
End If
End If
End If
If Jdown(1)
Add SP1,-1
If SP1<-1
SP1=-1
End If
End If
If COMP=0
If Key State(77)
Add SP2,-1
If SP2<-1
SP2=-1
End If
End If
End If
If Jleft(1)
Add F(1),-1
If F(1)<1
F(1)=8
End If
End If
If COMP=0
If Key State(78)
Add F(2),1
If F(2)>16
F(2)=9
End If
End If
End If
If Jright(1)
Add F(1),1
If F(1)>8
F(1)=1
End If
End If
If COMP=0
If Key State(79)
Add F(2),-1
If F(2)<9
F(2)=16
End If
End If
End If
If F(1)=1
Add Y(1),-SP1
End If
If F(1)=2
Add Y(1),-SP1 : Add X(1),SP1
End If
If F(1)=3
Add X(1),SP1
End If
If F(1)=4
Add X(1),SP1 : Add Y(1),SP1
End If
If F(1)=5
Add Y(1),SP1
End If
If F(1)=6
Add X(1),-SP1 : Add Y(1),SP1
End If
If F(1)=7
Add X(1),-SP1
End If
If F(1)=8
Add X(1),-SP1 : Add Y(1),-SP1
End If
If F(2)=9
Add Y(2),-SP2
End If
If F(2)=10
Add Y(2),-SP2 : Add X(2),SP2
End If
If F(2)=11
Add X(2),SP2
End If
If F(2)=12
Add X(2),SP2 : Add Y(2),SP2
End If
If F(2)=13
Add Y(2),SP2
End If
If F(2)=14
Add X(2),-SP2 : Add Y(2),SP2
End If
If F(2)=15
Add X(2),-SP2
End If
If F(2)=16
Add X(2),-SP2 : Add Y(2),-SP2
End If
If X(1)>295
X(1)=295
End If
If X(1)<0
X(1)=0
End If
If Y(1)<15
Y(1)=15
End If
If Y(1)>221
Y(1)=221
End If
If X(2)>295
X(2)=295
End If
If X(2)<0
X(2)=0
End If
If Y(2)<15
Y(2)=15
End If
If Y(2)>221
Y(2)=221
End If
'
If Fire(1) and FI1=0
IM1=I Bob(25)+16
FI1=1
MX1=X(1)
MY1=Y(1)
Bob 29,MX1,MY1,IM1
Bob 7,MX1-6,MY1+150,39
If SND=1
Sam Play 1,3,8000
End If
End If
'
If FI1=1
If IM1=17
Add MY1,-8
End If
If IM1=18
Add MX1,8 : Add MY1,-8
End If
If IM1=19
Add MX1,8
End If
If IM1=20
Add MX1,8 : Add MY1,8
End If
If IM1=21
Add MY1,8
End If
If IM1=22
Add MX1,-8 : Add MY1,8
End If
If IM1=23
Add MX1,-8
End If
If IM1=24
Add MX1,-8 : Add MY1,-8
End If
Bob 29,MX1,MY1,IM1
Bob 7,MX1-6,MY1+150,39
If MX1<0 or MX1>320 or MY1<0 or MY1>225
FI1=0
Bob Off 29
Bob Off 7
End If
End If
'
If COMP=0
If Inkey$=" " and FI2=0
IM2=I Bob(26)+8
FI2=2
MX2=X(2)
MY2=Y(2)
Bob 30,MX2,MY2,IM2
Bob 8,MX2-6,MY2+150,39
If SND=1
Sam Play 1,3,8000
End If
End If
End If
'
If FI2=2
If IM2=17
Add MY2,-8
End If
If IM2=18
Add MX2,8 : Add MY2,-8
End If
If IM2=19
Add MX2,8
End If
If IM2=20
Add MX2,8 : Add MY2,8
End If
If IM2=21
Add MY2,8
End If
If IM2=22
Add MX2,-8 : Add MY2,8
End If
If IM2=23
Add MX2,-8
End If
If IM2=24
Add MX2,-8 : Add MY2,-8
End If
Bob 30,MX2,MY2,IM2
Bob 8,MX2-6,MY2+150,39
If MX2<0 or MX2>320 or MY2<0 or MY2>225
FI2=0
Bob Off 30
Bob Off 8
End If
End If
If Bob Col(25,26 To 26)
SP1=-1
SP2=-1
Add D(1),1
Add D(2),1
End If
If Bob Col(29,32 To 32)
Bob Off 29
Bob Off 7
FI1=0
End If
If Bob Col(30,31 To 31)
Bob Off 30
Bob Off 8
FI2=0
End If
If Bob Col(29,26 To 26)
Add D(2),1
FI1=0
Bob Off 29
Bob Off 7
If SND=1
Sam Play 2,1,8000
End If
End If
If Bob Col(30,25 To 25)
Add D(1),1
FI2=0
Bob Off 30
Bob Off 8
If SND=1
Sam Play 2,1,8000
End If
End If
If Bob Col(29,60 To 60)
BONUS[1]
KB=1
Bob 61,X Bob(60),Y Bob(60),36
Bob 62,X Bob(60),Y Bob(60),37
Bob Off 60
B=0
FI1=0
Bob Off 29
Bob Off 60
End If
If Bob Col(30,60 To 60)
BONUS[2]
KB=1
Bob 61,X Bob(60),Y Bob(60),36
Bob 62,X Bob(60),Y Bob(60),37
Bob Off 60
B=0
FI2=0
Bob Off 30
Bob Off 8
End If
If KB=1
Bob 61,X Bob(61),Y Bob(61)-3,36
Bob 62,X Bob(62),Y Bob(62)+3,37
If Y Bob(62)>230 and Y Bob(61)<-10
KB=0 : Bob Off 61 : Bob Off 62
TIME=0
End If
End If
If SND=1
Add T,1
If T>7
Sam Play 4,2,8000
T=0
End If
End If
If D(1)>15
WIN=2
DEAD=True
End If
If D(2)>15
WIN=1
DEAD=True
End If
Screen 1
X$=Mid$(PL1$,1,8)+" Score:"+Str$(S(1))-" "+" "+"Damage:"+Str$(D(1))-" "+" "
X$=X$+Mid$(PL2$,1,8)+" Score : "+Str$(S(2))-" "+" "+"Damage : "+Str$(D(2))-" "+" "
Text 5,10,X$
Screen 0
Until DEAD=True
DEAD=False
If WIN=1
J=26
End If
If WIN=2
J=25
End If
Add K(WIN),1
Add S(WIN),1000
Channel 0 To Bob J
Amal 0,"A 0,(28,2)(29,2)(30,2)(31,2)(32,2)(33,2)(34,2)"
Amal On 0
Wait 100
Amal Off 0
Bob Off : Bob Clear
Fade 3 : Wait 15*3
Screen 1
Fade 3 : Wait 15*3
Screen Close 0
Screen Close 1
For F=1 To 2
D(F)=0
Next F
F(1)=3
F(2)=15
'
X(1)=0 : X(2)=295
Y(1)=15 : Y(2)=221
I1=25
B=0
'
For F=1 To 2
If K(F)>HI
HI=K(F)
If F=1
N$=PL1$
Else
N$=PL2$
End If
OF=NUMBER
End If
Next F
Next GAME
Open Out 1,"Hi-Snake.Dat"
Print #1,N$
Print #1,HI
Print #1,OF
Close 1
For F=1 To 2
S(F)=0
K(F)=0
Next F
KB=0
Loop
'
Procedure BONUS[PL]
A=Rnd(5)
If A=0
If D>1
Add D(PL),-1
End If
End If
If A=1
Add S(PL),1000
End If
If A=2
SH(PL)=1
End If
If A=3
Add D(PL),1
End If
If A=4
Add S(PL),-500
End If
If A=5
Add S(PL),3000
End If
End Proc
'
'
'
HELP:
Resume Next