home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
451-475
/
apd471
/
nomis.amos
/
nomis.amosSourceCode
Wrap
AMOS Source Code
|
1993-03-03
|
7KB
|
423 lines
Screen Open 1,320,256,16,Lowres
Curs Off : Flash Off
Paper 0
Cls
Screen Open 0,320,256,16,Lowres
Curs Off : Flash Off
Get Sprite Palette
Paper 0
Cls
Limit Mouse 135,50 To 440,290
Dim CM(100),HIGH(7),HIGHNAME$(7)
Global RNTHR,SCORE1,SCORE2
Global CM(),HIGH(),HIGHNAME$()
Global NAME1$,NAME2$
Global P,G,TMS,TMR,GESS,A,HGH,NX1
RNTHR=1
Dir$="catcher-two:"
Proc _INITHIGHSCORES
Proc _SETUP
Load "npics/title.abk",6
Load "samples/samples.abk",5
Music 1
Unpack 6 To 1
Screen Hide 1
Screen 0 : Double Buffer
Erase 6
Proc _EXPAND
Repeat : Until Mouse Key
RNTHR=1
MAIN:
Do
If RNTHR=1 Then Proc _NAMES
If RNTHR=2 Then Proc _GAMESTART
If RNTHR=3 Then Proc _HIGHSCORES
If RNTHR=4 Then Proc _FINISH
Loop
Procedure _GAMESTART
Proc _MIXUP
Unpack 8 To 1
Screen Hide 1
Ink 0,9
Text 15,90,NAME1$
Text 15,142,Str$(SCORE1)
Ink 2,9
Text 232,90,NAME2$
Text 232,142,Str$(SCORE2)
Ink 4,9
Text 78,235,HIGHNAME$(1)
HGH=HIGH(1)
Text 239,235,Str$(HGH)
Screen 0
Proc _EXPAND
Music Off
Clear Key
Bob 3,135,89,8
While Inkey$="" : Wend
Bob Off 3
Wait 20
TMS=1 : P=1 : TMR=30
Bob 2,160,40,7
Repeat
Proc _MACHINE
Proc _YOURGO
Proc _NEXT
Until RNTHR=3
If GESS=100 Then RNTHR=4
NX=0 : NX1=0
End Proc
Procedure _MACHINE
Ink 4,9
Text 127,186,"COMPUTER"
Wait 30
For F=0 To TMS
If CM(F)=1
Bob 1,135,62,1 : Bell 70
Else If CM(F)=2
Bob 1,209,87,2 : Bell 50
Else If CM(F)=3
Bob 1,136,160,3 : Bell 30
Else If CM(F)=4
Bob 1,110,87,4 : Bell 10
End If
End If
End If
End If
Wait TMR
Next F
Bob 1,135,62,5
End Proc
Procedure _YOURGO
Cls 9,119,175 To 201,191
If P=1
Ink 0 : Text 127,186,NAME1$
Else If P=2
Ink 2 : Text 127,186,NAME2$
End If
End If
Wait 30
GESS=0
YRGO2:
Q=0
Repeat
If Key State(76)=True
Bob 1,135,62,1 : Bell 70 : G=1 : Q=1
Else If Key State(78)=True
Bob 1,209,87,2 : Bell 50 : G=2 : Q=1
Else If Key State(77)=True
Bob 1,136,160,3 : Bell 30 : G=3 : Q=1
Else If Key State(79)=True
Bob 1,110,87,4 : Bell 10 : G=4 : Q=1
End If
End If
End If
End If
Until Q=1
Wait 10
If G<>CM(GESS) Then Proc _THEEND : Pop Proc
If P=1 and G=CM(GESS)
Add SCORE1,G
Ink 0 : Text 15,142,Str$(SCORE1)
Else If P=2 and G=CM(GESS)
Add SCORE2,G
Ink 2 : Text 232,142,Str$(SCORE2)
End If
End If
If SCORE1>HGH and NX1=0
Cls 9,71,223 To 153,239
Ink 0,9
Text 78,235,NAME1$
NX1=1
Else If SCORE2>HGH and SCORE2>SCORE1 and NX1=1
Cls 9,71,223 To 153,239
Ink 2,9
Text 78,235,NAME2$
NX1=2
End If
End If
If SCORE1>HGH and SCORE1>SCORE2
Ink 0,9
Text 239,235,Str$(SCORE1)
Else If SCORE2>HGH and SCORE2>SCORE1
Ink 2,9
Text 239,235,Str$(SCORE2)
End If
End If
Wait 10 : Clear Key
Inc GESS
If GESS=100 Then RNTHR=3 : Pop Proc
If GESS=TMS+1 Then Bob Off 1 : Pop Proc
Goto YRGO2
End Proc
Procedure _NEXT
Inc TMS
Bob Off 1
If TMS=10 Then TMR=20
If TMS=20 Then TMR=15
End Proc
Procedure _THEEND
Wait 20
Sam Play 15,1,9500 : Wait 50
Bob Off 1
Clear Key
If P=1
Bob 3,135,89,8
While Inkey$="" : Wend
Bob 2,160,40,Hrev(7)
P=2 : TMS=0 : TMR=30
Proc _MIXUP
Bob Off 3
NX1=1
Else If P=2
Bob 3,135,89,8
While Inkey$="" : Wend
Bob Off
RNTHR=3
Gr Writing 0
Ink 2
Text 120,40,"MOVING ON"
End If
End If
Clear Key
Wait 30
End Proc
Procedure _HIGHSCORES
Music 1
Clear Key
A=1
Repeat
If SCORE1>HIGH(A)
Proc _HIGHADD
A=99
End If
Inc A
Until A>=8
A=1
Repeat
If SCORE2>HIGH(A)
Proc _HIGHADD2
A=99
End If
Inc A
Until A>=8
Unpack 9 To 1
Screen Hide 1
Screen 1
LFT=7
Paper 9
For A=1 To 7
Pen A
Locate 3,LFT : Print A
Locate 13,LFT : Print HIGHNAME$(A)
Locate 29,LFT : Print HIGH(A)
Inc LFT : Inc LFT
Next A
Screen 0
Proc _EXPAND
Reserve Zone 2
Set Zone 1,10,209 To 158,238
Set Zone 2,162,209 To 310,238
Q=0
Repeat
M=Mouse Key
If M<>0 and Mouse Zone=1
Bob 1,30,185,Vrev(6)
SCORE1=0 : SCORE2=0
RNTHR=1 : Q=1
Else If M<>0 and Mouse Zone=2
Bob 1,290,185,Vrev(6)
SCORE1=0 : SCORE2=0
RNTHR=2 : Q=1
End If
End If
Until Q=1
Wait 50
Bob Off 1
Gr Writing 0
Ink 2
Text 120,40,"MOVING ON"
Open Random 1,"nomhighscr"
Field 1,8 As HN$,8 As HGH$
R=1
Repeat
HN$=HIGHNAME$(R)
HGH$=Str$(HIGH(R))
Put 1,R
Inc R
Until R=8
Close 1
Wait 50
Clear Key
End Proc
Procedure _HIGHADD
B=7
While B>A
HIGH(B)=HIGH(B-1)
HIGHNAME$(B)=HIGHNAME$(B-1)
Dec B
Wend
HIGH(A)=SCORE1
HIGHNAME$(A)=NAME1$
End Proc
Procedure _HIGHADD2
B=7
While B>A
HIGH(B)=HIGH(B-1)
HIGHNAME$(B)=HIGHNAME$(B-1)
Dec B
Wend
HIGH(A)=SCORE2
HIGHNAME$(A)=NAME2$
End Proc
Procedure _FINISH
Bob Off
Wait 20
For F=0 To 2
Sam Play 15,1,9500
Wait 30
Next F
Gr Writing 0
Ink 2
Text 92,40,"YOU ARE A WINNER"
Music 1
Load "npics/finish.abk",10
Unpack 10 To 1
Screen Hide 1
Screen 0
Wait 50
Erase 10
Proc _EXPAND
Wait 50
Paste Bob 130,68,8
While Inkey$="" : Wend
RNTHR=3
End Proc
Procedure _NAMES
Shared W,N$,NEND,M
Unpack 7 To 1
Screen Hide 1
Screen 0
Proc _EXPAND
Reserve Zone 32
N=3 : MM=92
For F=1 To 30
Set Zone F,N,MM To N+18,MM+18
Add N,21
If F=15 Then N=3 : MM=109
Next F
WRT:
NM=20 : NEND=0
NAME1$="" : NAME2$=""
Bob 1,195,175,6
Ink 0,9
Repeat
Proc _PICKLETTER
NAME1$=NAME1$+N$
Text 163,151,NAME1$
If W>0 Then Inc NM
Wait 20
If NEND=1 Then NM=28
Until NM=28
'
NM=20 : NEND=0
Bob 1,195,175,Vrev(6)
Ink 2,9
Repeat
Proc _PICKLETTER
NAME2$=NAME2$+N$
Text 163,206,NAME2$
If W>0 Then Inc NM
Wait 20
If NEND=1 Then NM=28
Until NM=28
Bob Off 1
Ink 4,11
Text 70,245,"ALL CORRECT (Y)-(N)?"
Box 166,237 To 189,247
Box 198,237 To 221,247
Set Zone 31,166,237 To 189,247
Set Zone 32,198,237 To 221,247
Q=0 : RGHT=0
Repeat
M=Mouse Key
If M<>0 and Mouse Zone=31
Cls 11,69,237 To 250,250
RGHT=1 : Q=1
Else If M<>0 and Mouse Zone=32
Reset Zone 31
Reset Zone 32
Cls 11,69,237 To 250,250
Cls 9,146,142 To 247,155
Cls 9,146,197 To 247,210
Q=1
End If : End If
Until Q=1
If RGHT=0 Then Goto WRT
RNTHR=2
End Proc
Procedure _PICKLETTER
Shared W,N$,NEND,SCRL$,M
Q=0 : W=0
Repeat
M=Mouse Key
If M<>0
W=Mouse Zone : Q=1
End If
Until Q=1
If W=30 Then NEND=1 : N$=""
If W<30
N$=Mid$(SCRL$,W,1)
End If
If W=0 Then N$=""
End Proc
Procedure _MIXUP
Randomize Timer
For F=0 To 200
A=Rnd(100)
B=Rnd(100)
Swap CM(A),CM(B)
Next F
End Proc
Procedure _EXPAND
Shared SCRN
If SCRN=2
Proc _LEFTTORIGHT : SCRN=1
Else If SCRN=1
Proc _TOPTOBOTTOM : SCRN=2
End If
End If
End Proc
Procedure _LEFTTORIGHT
For F=0 To 320
Screen Copy 1,0,0,F,256 To 0,0,0
Screen Swap : Wait Vbl
Next F
End Proc
Procedure _TOPTOBOTTOM
For F=0 To 256
Screen Copy 1,0,0,320,F To 0,0,0
Screen Swap : Wait Vbl
Next F
End Proc
Procedure _SETUP
SCORE1=0 : SCORE2=0
End Proc
Procedure _INITHIGHSCORES
Shared SCRN,SCRL$
SCRL$="ABCDEFGHIJKLMNOPQRSTUVWXYZ -."
SCRN=1 : NX1=0
For F=0 To 100
A=Rnd(3)+1
CM(F)=A
Next F
Open Random 1,"nomhighscr"
Field 1,8 As HN$,8 As HGH$
R=1
Repeat
Get 1,R
HIGHNAME$(R)=HN$
HIGH(R)=Val(HGH$)
Inc R
Until R=8
Close 1
End Proc