home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
176-200
/
apd197
/
defusion.amos
/
defusion.amosSourceCode
< prev
next >
Wrap
AMOS Source Code
|
1991-04-06
|
7KB
|
273 lines
'April 91
Dim C(7),X(4),PC(7),FX(4),FY(4),USED(4),POS(5)
Global LEVEL,SCORE,FUSE,DELAY,PIC,C(),X(),PC(),FX(),FY(),USED(),GUESS,MV,POS()
Global LEVEL,SCORE
Randomize Timer
STRT:
TITLE : INIT
MAIN:
THINKOFCOLOURS : MIXCOLOURS : MAINLOOP
Procedure MAINLOOP
Unpack 6 To 0
For A=1 To 4 : Ink PC(A)*2+3,
Bar X(A),86 To X(A)+13,97
Next A
SCORE$=Str$(SCORE) : SCORE$=Right$(SCORE$,Len(SCORE$)-1)
SCORE$=String$("0",5-Len(SCORE$))+SCORE$
LEV$=Str$(LEVEL) : LEV$=Right$(LEV$,Len(LEV$)-1)
LEV$=String$("0",3-Len(LEV$))+LEV$
Gr Writing 0 : Ink 0, : Text 247,138,SCORE$ : Text 257,96,LEV$
Ink 11, : Text 248,137,SCORE$
Text 256,95,LEV$
Gr Writing 1 : Reserve Zone 10
For A=1 To 4
Set Zone A,X(A),70 To X(A)+12,83
Set Zone A+4,X(A),101 To X(A)+12,114
Next A
Set Zone 9,137,153 To 184,163
Set Zone 10,228,48 To 301,58
FUSE=1
GUESS=0
Music 1 : Mvolume MV
While FUSE<(290*DELAY)
BURNFUSE
If Mouse Key
CHKMOVE
End If
Wend
NDGAME
End Proc
Procedure INIT
DELAY=7 : MV=60 : SCORE=0 : LEVEL=1
X(1)=125 : X(2)=145 : X(3)=164 : X(4)=183
FX(1)=153 : FX(2)=161 : FX(3)=153 : FX(4)=161
FY(1)=123 : FY(2)=123 : FY(3)=132 : FY(4)=132
Sprite 1,100,100,5
Channel 1 To Sprite 1
Amal 1,"L: Let X=XM ; Let Y=YM ; Jump L"
Amal On
Voice 1
Volume 1,35
End Proc
Procedure BURNFUSE
Inc FUSE
Ink 4, : Add PIC,1,1 To 4
Bar 316-(FUSE/DELAY),176 To 328-(FUSE/DELAY),194
Paste Bob 313-(FUSE/DELAY),177,PIC : Wait Vbl : Wait Vbl
End Proc
Procedure XPLODE
Music Off : Volume 63
Boom
Ink 4, : Bar 0,165 To 320,200
For A=10 To 21
Bob 1,1,167,A
Wait 3 : Wait Vbl
Next
Bar 0,165 To 30,200
End Proc
Procedure THINKOFCOLOURS
L:
For A=1 To 4
C(A)=Rnd(5)+1
Next A
For A=1 To 4
For AA=A+1 To 5
If C(A)=C(AA) Then Goto L
Next AA
Next A
End Proc
Procedure MIXCOLOURS
M:
For A=1 To 4
PC(A)=Rnd(5)+1
Next A
For A=1 To 4
For AA=A+1 To 5
If PC(A)=PC(AA) Then Goto M
Next AA
Next A
If C(1)=PC(1) or C(2)=PC(2) or C(3)=PC(3) or C(4)=PC(4) Then MIXCOLOURS
' DRWBOARD
End Proc
Procedure CHKMOVE
MZ=Mouse Zone
If MZ=0 Then Pop Proc
If MZ=9 Then Play 1,50,0 : CHKLIGHTS : Pop Proc
If MZ=10 Then MV=MV xor 60 : Mvolume MV : BURNFUSE : Wait Vbl : Pop Proc
For A=1 To 4 : USED(A)=0 : Next A
If MZ<=4
Dec PC(MZ)
If PC(MZ)=0
PC(MZ)=6
End If
MVCOLUP[MZ]
Else
Add PC(MZ-4),1,1 To 6
MVCOLDN[MZ-4]
End If
End Proc
Procedure MVCOLUP[CNUM]
For A=1 To 11
BURNFUSE
Ink(PC(CNUM)*2)+3,
Bar X(CNUM),97-A To X(CNUM)+13,97
Play 1,(A*2)+CNUM+40,0
Wait Vbl
Next
End Proc
Procedure MVCOLDN[CNUM]
For A=1 To 11
BURNFUSE
Ink(PC(CNUM)*2)+3,
Bar X(CNUM),86 To X(CNUM)+13,86+A
Play 1,((12-A)*2)+CNUM+40,0
Wait Vbl
Next
End Proc
Procedure CHKLIGHTS
S:
For A=1 To 4
USED(A)=0
POS(A)=Rnd(3)+1
Next A
For A=1 To 4
For AA=A+1 To 5
If POS(A)=POS(AA) Then Goto S
Next AA
Next A
For A=1 To 4
FX=FX(POS(A))+4 : FY=FY(POS(A))+4
If C(A)=PC(A)
Ink 9, : CIRC[FX,FY,3] : USED(A)=9
Else Ink 11, : CIRC[FX,FY,3]
End If
Next
For A=1 To 4
FX=FX(POS(A))+4 : FY=FY(POS(A))+4
For AA=1 To 4
If C(A)=PC(AA)
If USED(A)=0
Ink 13, : CIRC[FX,FY,3] : USED(A)=13
End If
End If
Next AA
Next A
SHSCORE
End Proc
Procedure CIRC[CX,CY,R]
For RR=1 To R
Circle CX,CY,RR
Next
Ink 0,
Circle CX,CY,R
End Proc
Procedure SHSCORE
For A=1 To 4
Ink(PC(A)*2)+3,
CIRC[21+(A*8),69+(GUESS*8),3]
If USED(A)=0 Then USED(A)=11
Ink USED(A),
CIRC[56+(POS(A)*7),69+(GUESS*8),2]
Next
If C(1)=PC(1) and C(2)=PC(2) and C(3)=PC(3) and C(4)=PC(4) Then CONGRATS
Inc GUESS
If GUESS=10 Then NDGAME
End Proc
Procedure NDGAME
XPLODE
Wait 30
Ink 16, : Bar 98,65 To 222,147
Music 1 : Mvolume 60 : Gr Writing 0
Ink 1,
Text 100,76," You failed to"
Text 100,86," find the"
Text 100,96,"code which was:"
Gr Writing 1
For A=1 To 4
Ink(C(A)*2)+3,
CIRC[(A*16)+118,115,7]
Next A
While Mouse Key=0 : Wend
For V=60 To 1 Step -1 : Mvolume V : Wait Vbl : Next
Goto STRT
End Proc
Procedure CONGRATS
SCORE=SCORE+(FUSE/10)
SCORE=SCORE+((11-GUESS)*5)
SCORE=SCORE*5
Ink 16, : Bar 98,65 To 222,147
Music 1 : Mvolume 30 : Gr Writing 0
Ink 0,16 : Text 101,76,"Congratulations"
Ink 1,16 : Text 102,77,"Congratulations"
Text 100,90," You found the"
Text 100,100," combination"
Text 100,135," and defused"
Text 100,145," the bomb."
SCORE$=Str$(SCORE) : SCORE$=Right$(SCORE$,Len(SCORE$)-1)
SCORE$=String$("0",5-Len(SCORE$))+SCORE$
Gr Writing 1
Ink 0,25
Text 247,138,SCORE$
Gr Writing 0
Ink 11, : Text 248,137,SCORE$
Gr Writing 1
For A=1 To 4
Ink(PC(A)*2)+3,
CIRC[(A*16)+118,115,7]
Next
Ink 4,
For A=320 To 0 Step -1
Draw A,169 To A,199
Wait Vbl
Next
While Mouse Key=0 : Wend
For V=30 To 1 Step -1 : Mvolume V : Wait Vbl : Next
Dec DELAY : Inc LEVEL : FUSE=1
If DELAY<1 Then DELAY=1
Goto MAIN
End Proc
Procedure TITLE
Music 1 : Mvolume 60 : Sprite Off : Show On
Screen Open 0,250,140,32,Lowres : Curs Off : Flash Off : Cls 0 : Get Sprite Palette
Flash 11,"(100,3)(300,3)(500,3)(700,3)(900,3)(a00,3)(c00,3)(a00,3)(900,3)(700,3)(500,3)(300,3)"
Screen Display 0,175,100,,
Limit Mouse 225,183 To 340,226
Reserve Zone 2 : Paste Bob 37,20,22
Paper 0 : Pen 7
Locate 3,1 : Print "Pixel Precision Presents"
Pen 1
Locate 7,8 : Print "By Dominic Ramsey"
Pen 24
Locate 8,11 : Print Border$(Zone$(" PLAY ",1),1)
Locate 8,14 : Print Border$(Zone$(" INSTRUCTIONS ",2),2)
GM:
While Mouse Key=0 : MZ=Mouse Zone : Wend
If MZ=0 Then Goto GM
Flash Off : Fade 3
If MZ=1
For V=63 To 0 Step -2
Mvolume V : Wait Vbl
Next V
Music Off : Limit Mouse : Hide On
Pop Proc
End If
Fade 2 : Wait 30
Screen Open 0,320,200,4,Lowres : Curs Off : Cls 0 : Palette 0,0,0,0
Paper 0 : Pen 1 : Hide On
Fade 3,0,$FFF,$F55,$F0
X$=At(8,1)+Pen$(1)+"Defusion By D. Ramsey"+At(0,3)+Pen$(2)
X$=X$+"Your mission, should you decide to accept it is to defuse as many"
X$=X$+" bombs as possible before they explode. This is done by finding "
X$=X$+"the special colour combination to defuse each bomb."+At(0,9)
X$=X$+"Each colour can be changed by clicking on the arrows above and"
X$=X$+" below each colour. Your chosen combination can thenbe tried by"
X$=X$+" clicking on the 'DEFUSE' button."+At(0,15)
X$=X$+"Four lights below the main panel will now indicate how close you were "
X$=X$+"to the correct combination. A green light indicates a correct colour "
X$=X$+"in the correct place, orange indicates a correct colour in the wrong "
X$=X$+"place, and red indicates a wrong colour."+At(0,23)
X$=X$+"You have 10 chances to find the code before the bomb explodes."
Print X$
While Mouse Key=0 : Wend : X$="" : Fade 2 : Wait 30 : Show On
TITLE
End Proc