home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
sourcecode
/
procedures
/
lightcycles.amos
/
lightcycles.amosSourceCode
< prev
next >
Wrap
AMOS Source Code
|
1978-02-21
|
8KB
|
309 lines
Rem ** LightCycles By J.Hale **
Unpack 1 To 0
Curs Off
Hide On
Paper 0
Ink 0
Bar 0,0 To 10,10
Ink 2
Locate 0,8
Centre "1,2 or 4 PLAYERS?"
76 FLOP$=Inkey$
If FLOP$="" Then Goto 76
If FLOP$="1" Then COMP=1
If FLOP$="2" Then COMP=0
If FLOP$="4" Then COMP=4
Locate 0,10
Centre "ARE REDS LETHAL?"
10 R$=Inkey$
If R$="" Then Goto 10
If R$="y" Then RED=2 Else RED=6
Locate 0,12
Centre "LEVEL 1,2 OR 3?"
11 L$=Inkey$
If L$="" Then Goto 11
If L$="1" Then TIME=2 Else TIME=1
If L$="3" Then TIME=0
Randomize Timer
45
Load "df0:sample1"
50 Unpack 1 To 0
Ink 12
Box 0,0 To 319,255
Paper 0
Curs Off
Hide On
Paper 0
Ink 0
Bar 1,1 To 10,10
Ink 12
Box 0,0 To 319,255
X=3
Y=147
AX=311
AY=147
D=2
AD=4
PLING=0
AGAMES=0
BGAMES=0
CGAMES=0
DGAMES=0
DISTANCE=Rnd(250)+50
If COMP=1 Then Goto 147
If COMP=4 Then Goto 1000
1
Ink 6
Plot X,Y
If Jup(1) and D<>3 and D<>1 Then D=1 : Sam Play 13
If Jright(1) and D<>4 and D<>2 Then D=2 : Sam Play 13
If Jdown(1) and D<>1 and D<>3 Then D=3 : Sam Play 13
If Jleft(1) and D<>2 and D<>4 Then D=4 : Sam Play 13
If D=1 Then Y=Y-1
If D=2 Then X=X+1
If D=3 Then Y=Y+1
If D=4 Then X=X-1
If Point(X,Y)=6 or Point(X,Y)=12 or Point(X,Y)=RED Then Goto GREENDIE
Ink 3
Plot X,Y
Ink 12
Plot AX,AY
If Jup(0) and AD<>3 and AD<>1 Then AD=1 : Sam Play 13
If Jright(0) and AD<>4 and AD<>2 Then AD=2 : Sam Play 13
If Jdown(0) and AD<>1 and AD<>3 Then AD=3 : Sam Play 13
If Jleft(0) and AD<>2 and AD<>4 Then AD=4 : Sam Play 13
If AD=1 Then AY=AY-1
If AD=2 Then AX=AX+1
If AD=3 Then AY=AY+1
If AD=4 Then AX=AX-1
If Point(AX,AY)=6 or Point(AX,AY)=12 or Point(AX,AY)=RED Then Goto BLUEDIE
Ink 3
Plot AX,AY
If TIME>0 Then Wait TIME
Goto 1
147
Ink 6
Plot X,Y
If Jup(1) and D<>3 and D<>1 Then D=1 : Sam Play 13
If Jright(1) and D<>4 and D<>2 Then D=2 : Sam Play 13
If Jdown(1) and D<>1 and D<>3 Then D=3 : Sam Play 13
If Jleft(1) and D<>2 and D<>4 Then D=4 : Sam Play 13
If D=1 Then Y=Y-1
If D=2 Then X=X+1
If D=3 Then Y=Y+1
If D=4 Then X=X-1
If Point(X,Y)=6 or Point(X,Y)=12 or Point(X,Y)=RED Then Goto GREENDIE
Ink 3
Plot X,Y
Ink 12
SX=AX
SY=AY
GUF=Rnd(2)+1
If AD=1 and GUF=1 Then GUF=4
If AD=2 and GUF=2 Then GUF=3
If AD=3 and GUF=1 Then GUF=4
If AD=4 and GUF=2 Then GUF=3
If DISTANCE=0 and AD=1 and GUF=2 and Point(AX+1,AY)<>6 and Point(AX+1,AY)<>12 and Point(AX+1,AY)<>RED Then PLING=1
If DISTANCE=0 and AD=1 and GUF=4 and Point(AX-1,AY)<>6 and Point(AX-1,AY)<>12 and Point(AX-1,AY)<>RED Then PLING=1
If DISTANCE=0 and AD=2 and GUF=1 and Point(AX,AY-1)<>6 and Point(AX,AY-1)<>12 and Point(AX,AY-1)<>RED Then PLING=1
If DISTANCE=0 and AD=2 and GUF=3 and Point(AX,AY+1)<>6 and Point(AX,AY+1)<>12 and Point(AX,AY+1)<>RED Then PLING=1
If DISTANCE=0 and AD=3 and GUF=2 and Point(AX+1,AY)<>6 and Point(AX+1,AY)<>12 and Point(AX+1,AY)<>RED Then PLING=1
If DISTANCE=0 and AD=3 and GUF=4 and Point(AX-1,AY)<>6 and Point(AX-1,AY)<>12 and Point(AX-1,AY)<>RED Then PLING=1
If DISTANCE=0 and AD=4 and GUF=1 and Point(AX,AY-1)<>6 and Point(AX,AY-1)<>12 and Point(AX,AY-1)<>RED Then PLING=1
If DISTANCE=0 and AD=4 and GUF=3 and Point(AX,AY+1)<>6 and Point(AX,AY+1)<>12 and Point(AX,AY+1)<>RED Then PLING=1
If PLING=1 Then AD=GUF : Sam Play 13
PLING=0
If DISTANCE=0 Then DISTANCE=Rnd(250)+50
BILLY=Rnd(1)+1
If AD=1 and BILLY=2 Then BILLY=4
If AD=1 and BILLY=1 Then BILLY=2
If AD=2 and BILLY=2 Then BILLY=3
If AD=3 and BILLY=1 Then BILLY=4
If AD=4 and BILLY=2 Then BILLY=3
If AD=1 and Point(AX,AY-1)=6 or AD=1 and Point(AX,AY-1)=12 or AD=1 and Point(AX,AY-1)=RED Then AD=BILLY : Sam Play 13
If AD=2 and Point(AX+1,AY)=6 or AD=2 and Point(AX+1,AY)=12 or AD=2 and Point(AX+1,AY)=RED Then AD=BILLY : Sam Play 13
If AD=3 and Point(AX,AY+1)=6 or AD=3 and Point(AX,AY+1)=12 or AD=3 and Point(AX,AY+1)=RED Then AD=BILLY : Sam Play 13
If AD=4 and Point(AX-1,AY)=6 or AD=4 and Point(AX-1,AY)=12 or AD=4 and Point(AX-1,AY)=RED Then AD=BILLY : Sam Play 13
If AD=1 Then AY=AY-1
If AD=2 Then AX=AX+1
If AD=3 Then AY=AY+1
If AD=4 Then AX=AX-1
DISTANCE=DISTANCE-1
If Point(AX,AY)=6 or Point(AX,AY)=12 or Point(AX,AY)=RED Then Goto BLUEDIE
Ink 3
Plot AX,AY
Ink 12
Plot SX,SY
If TIME>0 Then Wait TIME
Goto 147
GREENDIE:
Sam Play 5
Locate 10,10
Pen 12
Centre "-=BLUE WINS=-"
Ink 0
Wait Key
Goto 50
BLUEDIE:
Sam Play 5
Locate 10,10
Pen 6
Centre "-=GREEN WINS=-"
Ink 0
Wait Key
Goto 50
1000
Unpack 1 To 0
Curs Off
Hide On
Ink 12
Box 0,0 To 319,255
Ink 0
Bar 1,1 To 10,10
AX=3
AY=49
AD=2
ACOL=3
ADIE=0
ADOSH=0
BX=3
BY=245
BD=2
BCOL=6
BDIE=0
BDOSH=0
CX=311
CY=49
CD=4
CCOL=12
CDIE=0
CDOSH=0
DX=311
DY=245
DD=4
DCOL=5
DDIE=0
DDOSH=0
1010
Paper 0
If ADIE=1 Then Goto 1020
Ink ACOL
Plot AX,AY
If Jup(1) and AD<>1 and AD<>3 Then AD=1 : Sam Play 13
If Jright(1) and AD<>2 and AD<>4 Then AD=2 : Sam Play 13
If Jdown(1) and AD<>3 and AD<>1 Then AD=3 : Sam Play 13
If Jleft(1) and AD<>4 and AD<>2 Then AD=4 : Sam Play 13
If AD=1 Then AY=AY-1
If AD=2 Then AX=AX+1
If AD=3 Then AY=AY+1
If AD=4 Then AX=AX-1
If Point(AX,AY)=ACOL or Point(AX,AY)=BCOL or Point(AX,AY)=CCOL or Point(AX,AY)=DCOL Then ADIE=1 : Sam Play 5
If BDIE=0 and ADIE=1 Then BDOSH=BDOSH+10
If CDIE=0 and ADIE=1 Then CDOSH=CDOSH+10
If DDIE=0 and ADIE=1 Then DDOSH=DDOSH+10
Ink 3
Plot AX,AY
If ADOSH=30 Then Goto 2000
1020
If BDIE=1 Then Goto 1030
Ink BCOL
Plot BX,BY
If Jup(0) and BD<>1 and BD<>3 Then BD=1 : Sam Play 13
If Jright(0) and BD<>2 and BD<>4 Then BD=2 : Sam Play 13
If Jdown(0) and BD<>3 and BD<>1 Then BD=3 : Sam Play 13
If Jleft(0) and BD<>4 and BD<>2 Then BD=4 : Sam Play 13
If BD=1 Then BY=BY-1
If BD=2 Then BX=BX+1
If BD=3 Then BY=BY+1
If BD=4 Then BX=BX-1
If Point(BX,BY)=ACOL or Point(BX,BY)=BCOL or Point(BX,BY)=CCOL or Point(BX,BY)=DCOL Then BDIE=1 : Sam Play 5
If ADIE=0 and BDIE=1 Then ADOSH=ADOSH+10
If CDIE=0 and BDIE=1 Then CDOSH=CDOSH+10
If DDIE=0 and BDIE=1 Then DDOSH=DDOSH=10
Ink 3
Plot BX,BY
If BDOSH=30 Then Goto 2000
1030
If CDIE=1 Then Goto 1040
Ink CCOL
Plot CX,CY
C$=Inkey$
If C$="q" and CD<>1 and CD<>3 Then CD=1 : Sam Play 13
If C$="a" and CD<>1 and CD<>3 Then CD=3 : Sam Play 13
If C$="z" and CD<>4 and CD<>2 Then CD=4 : Sam Play 13
If C$="x" and CD<>4 and CD<>2 Then CD=2 : Sam Play 13
If CD=1 Then CY=CY-1
If CD=2 Then CX=CX+1
If CD=3 Then CY=CY+1
If CD=4 Then CX=CX-1
If Point(CX,CY)=ACOL or Point(CX,CY)=BCOL or Point(CX,CY)=CCOL or Point(CX,CY)=DCOL Then CDIE=1 : Sam Play 5
If ADIE=0 and CDIE=1 Then ADOSH=ADOSH+10
If BDIE=0 and CDIE=1 Then BDOSH=BDOSH+10
If DDIE=0 and CDIE=1 Then DDOSH=DDOSH+10
Ink 3
Plot CX,CY
If CSCORE=30 Then Goto 2000
1040
If DDIE=1 Then Goto 1050
Ink DCOL
Plot DX,DY
D$=Inkey$
If D$="]" and DD<>1 and DD<>3 Then DD=1 : Sam Play 13
If D$="#" and DD<>1 and DD<>3 Then DD=3 : Sam Play 13
If D$="/" and DD<>2 and DD<>4 Then DD=2 : Sam Play 13
If D$="." and DD<>2 and DD<>4 Then DD=4 : Sam Play 13
If DD=1 Then DY=DY-1
If DD=2 Then DX=DX+1
If DD=3 Then DY=DY+1
If DD=4 Then DX=DX-1
If Point(DX,DY)=ACOL or Point(DX,DY)=BCOL or Point(DX,DY)=CCOL or Point(DX,DY)=DCOL Then DDIE=1 : Sam Play 5
If ADIE=0 and DDIE=1 Then ADOSH=ADOSH+10
If BDIE=0 and DDIE=1 Then BDOSH=BDOSH+10
If CDIE=0 and DDIE=1 Then CDOSH=CDOSH+10
Ink 3
Plot DX,DY
If DSCORE=30 Then Goto 2000
1050
If TIME>0 Then Wait TIME
If ADIE+BDIE+CDIE+DDIE>2 Then Goto 2000
Goto 1010
2000
Sam Play 10
Locate 14,8
Pen ACOL
Print "Player 1: ";ADOSH
Locate 14,10
Pen BCOL
Print "Player 2: ";BDOSH
Locate 14,12
Pen CCOL
Print "Player 3: ";CDOSH
Locate 14,14
Pen DCOL
Print "Player 4: ";DDOSH
Locate 14,16
TIE=1
If ADOSH>BDOSH and ADOSH>CDOSH and ADOSH>DDOSH Then Pen ACOL : Print "Player 1 Wins" : TIE=0
If BDOSH>ADOSH and BDOSH>CDOSH and BDOSH>DDOSH Then Pen BCOL : Print "Player 2 Wins" : TIE=0
If CDOSH>ADOSH and CDOSH>BDOSH and CDOSH>DDOSH Then Pen CCOL : Print "Player 3 Wins" : TIE=0
If DDOSH>ADOSH and DDOSH>BDOSH and DDOSH>CDOSH Then Pen DCOL : Print "Player 4 Wins" : TIE=0
If ADOSH=30 Then AGAMES=AGAMES+1
If BDOSH=30 Then BGAMES=BGAMES+1
If CDOSH=30 Then CGAMES=CGAMES+1
If DDOSH=30 Then DGAMES=DGAMES+1
If TIE=1 Then Pen ACOL : Print "-=A Draw=-"
Locate 12,18
Pen ACOL
Print "Player 1 Games: ";AGAMES
Locate 12,20
Pen BCOL
Print "Player 2 Games: ";BGAMES
Locate 12,22
Pen CCOL
Print "Player 3 Games: ";CGAMES
Locate 12,24
Pen DCOL
Print "Player 4 Games: ";DGAMES
Wait Key
Sam Play 10
Goto 1000