home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
17 Bit Software 3: The Continuation
/
17-Bit_The_Continuation_Disc.iso
/
files
/
asn68.dms
/
asn68.adf
/
autoexec.amos
/
autoexec.amosSourceCode
next >
Wrap
AMOS Source Code
|
1990-09-06
|
8KB
|
294 lines
' DEMOLITION MISSION by SAROG copyright 1990
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Auto View Off : Close Workbench
'Load "dh0:amos files/biplane38.abk"
'Load "dh0:amos files/samplesBomber.abk"
'Load "dh0:amos music/thesong.abk"
Screen Open 0,352,290,16,Lowres
Load Iff "df0:demscr",0
Hide On : Curs Off : Flash Off
Screen Open 1,352,290,16,Lowres
Get Sprite Palette : Hide On : Curs Off : Flash Off
Screen Hide 1 : Screen Show 0 : Auto View On
Wait 50 : Music 1 : Tempo 16
Get Disc Fonts : Screen 1 : Double Buffer
Cls 0 : Set Font 3 : Ink 15,0
Text 10,80,"DEMOLITION MISSION"
Set Font 5 : Ink 8,0
Text 35,120,"WAS WRITTEN BY SAROG"
Text 24,150,"USING AMOS THE CREATOR"
Set Font 4 : Ink 5,0
Text 48,210,"PRESS FIRE TO PLAY"
Pen 11 : Paper 0 : Locate 0,30 : Centre "SPACE TO PAUSE"
Screen 0 : Set Font 1 : Screen 1 : Set Font 7 : Reserve Zone 17
Wait 500 : Screen 0 : Fade 8 : Wait 120 : Cls 0
Screen Hide 0 : Screen Show 1
Screen 0 : Get Sprite Palette
Randomize Timer : Make Mask
Dim NAME$(10),HISCORE(10),ZNTOP(16),BUILD(16),IMG(16)
Open In 1,"df0:hiscores"
For F=0 To 9
Line Input #1,HISCORE(F)
Line Input #1,NAME$(F)
Next F
Close 1
Global A1$,A2$,A3$,A4$,A5$,A9$,A10$,A11$,HISCORE(),NAME$(),ZNTOP(),BUILD()
Global PHEIGHT,BHEIGHT,ZN,CRASH,ZNTOP,FLAMES,BLDS,IMG()
Global ZNCOUNT,LEVEL,STDHT,FLAG,SCORE,LIN,CHUNK,MISS,MUSVOL
For F=1 To 15 : Channel F To Bob F : Next F : PATHS
For F=1 To 16 : BUILD(F)=F : Next F : MUSVOL=25
Repeat : Until Fire(1) : Clear Key
'
RESTART:
Screen Hide 0 : Screen Show 1 : Screen 1 : Cls 0
LEVEL=1 : STDHT=150 : FLAG=1 : SCORE=0
'
LEVELUP:
PHEIGHT=50 : ZN=0 : ZNCOUNT=16 : MISS=0
Ink 6,1 : Set Pattern 2 : Pen 15 : Paper 0 : SKY1
Locate 9,2 : Print "LEVEL ";LEVEL : Locate 25,2 : Print "SCORE ";SCORE
Bar 0,251 To 351,290
Set Zone 17,0,251 To 351,290
BUILDINGS
For F=0 To MUSVOL : Mvolume F : Wait 1 : Next F
Bob 1,0,PHEIGHT,1
Amal 1,A1$ : Amal On 1
'
'
Do
If Chanmv(1)=0
Add PHEIGHT,10,50 To 250
Exit If ZNCOUNT=0
Bob 1,0,PHEIGHT,1
Amal 1,A1$
Amal On 1
End If
'
If Chanmv(2)<>0
ZN=Zone(X Bob(2),Y Bob(2))
If ZN
Bob 3,X Bob(2),Y Bob(2),6
DEMOLISH
End If
Else If Fire(1)
Bob 2,X Bob(1)-12,PHEIGHT,22
Amal 2,A2$
Amal On 2
End If
End If
'
If Inkey$=" " Then PAUSE
'
CRASH=Zone(X Bob(1),Y Bob(1))
If CRASH
DEATH : FLAG=0 : Exit
End If
Loop
'
'
If FLAG
Bob Off 1
Bob 9,0,250,1 : Amal 9,A9$ : Amal On 9
For F=MUSVOL To 0 Step -1 : Mvolume F : Wait 1 : Next F
Repeat : Until Chanmv(9)=0 : Bob Off 9 : Bob 10,100,250,34
Amal 10,A10$ : Amal On 10 : Sam Play 15,1,7000 : Wait 90 : Sam Play 2
BONUS=500+(300*LEVEL) : PNLTY=(MISS*20)+((PHEIGHT-100)*2)
If PNLTY>BONUS
PNLTY=BONUS
End If
Pen 11 : Locate 13,10 : Print "LEVEL BONUS = ";BONUS : Wait 50
For F=BONUS To BONUS-PNLTY Step -20 : Locate 27,10 : Print F;" " : Bell : Next F
Wait 140 : Bob Off 10 : Add LEVEL,1 : PHEIGHT=50 : Add SCORE,BONUS-PNLTY
If STDHT>70
Add STDHT,-10
End If
Locate 13,10 : Print Space$(20)
Goto LEVELUP
End If
Wait 150 : Bob Off : HISCORES
Pen 12 : Locate 0,28 : Centre "Music: 1-Loud 2-Soft 3-Silent"
Pen 14 : Locate 0,30 : Centre "PRESS FIRE TO PLAY"
Repeat
I$=Inkey$
If I$="1" Then MUSVOL=63
If I$="2" Then MUSVOL=25
If I$="3" Then MUSVOL=0
If I$<>"" Then Mvolume MUSVOL
Until Fire(1)
Goto RESTART
'
'
Procedure BUILDINGS
BCR=8 : PTRN=29 : APEX=30 : BLDS=8+LEVEL : SHUFFLE
For F=1 To 16
ZN=BUILD(F)
Add BCR,1,8 To 11 : Ink BCR,0 : IMG(ZN)=BCR+18
Add PTRN,1,29 To 34
Add APEX,1,30 To 33
If F<=BLDS
BHEIGHT=Rnd(80)
Set Pattern PTRN
Bar BUILD(F)*20-3,BHEIGHT+STDHT To BUILD(F)*20+10,250
Paste Bob BUILD(F)*20-3,BHEIGHT+STDHT-4,APEX
Set Zone ZN,BUILD(F)*20-3,BHEIGHT+STDHT-4 To BUILD(F)*20+10,250
ZNTOP(ZN)=BHEIGHT+STDHT-4
Noise To 15 : For G=ZN*5 To(ZN+1)*5 : Play G,1 : Next G
Else
Reset Zone ZN
Add ZNCOUNT,-1
ZNTOP(ZN)=0
End If
Next F
End Proc
Procedure DEMOLISH
If ZN=17
Sam Play 12,5,15000
Inc MISS
Else
Sam Play 12,5,6000
End If
Amal 3,A3$ : Amal On 3 : Bob Off 2
If Bob Col(3)
For F=5 To 8
If Col(F)
Bob Off F
End If
Next F
End If
If ZN=17 Then Pop Proc
CHUNK=Rnd(10)+10 : Add SCORE,15 : Locate 31,2 : Print SCORE
Add ZNTOP(ZN),CHUNK : Ink 0
If ZNTOP(ZN)>=247
Reset Zone ZN : Add ZNCOUNT,-1
Bar ZN*20-3,247-CHUNK To ZN*20+10,250
ZNTOP(ZN)=0 : Pop Proc
Else
Set Zone ZN,ZN*20-3,ZNTOP(ZN) To ZN*20+10,250
End If
Bar ZN*20-3,ZNTOP(ZN)-CHUNK To ZN*20+10,ZNTOP(ZN)+4
Paste Bob ZN*20-3,ZNTOP(ZN)+1,IMG(ZN)
Add FLAMES,1,5 To 8
Bob FLAMES,ZN*20-3,ZNTOP(ZN)+4,23
Amal FLAMES,A5$ : Amal On FLAMES
End Proc
Procedure PATHS
A1$="A 0,(1,5)(2,5)(3,5)(4,5); M 390,0,260"
A2$="M 0,220,100"
A3$="A 1,(6,4)(7,4)(8,4)(9,4)(21,4); M 0,0,5"
A4$="A 1,(9,9)(10,9)(11,9)(12,9)(13,9)(14,9)(15,9)(16,9)"
A4$=A4$+"(17,9)(18,9)(19,9)(20,9)(21,9);M 0,0,13"
A5$="A 0,(23,12)(24,12)(25,12);M 0,0,2"
A9$="A 0,(1,5)(2,5)(3,5)(4,5);M 100,0,66"
A10$="A 0,(37,10)(38,10);M 0,0,2"
A11$="A 1,(34,7)(35,7)(36,7);M 0,0,3"
End Proc
Procedure DEATH
Bob 11,X Bob(1),Y Bob(1)-3,34
Amal 11,A11$ : Amal On 11 : Sam Play 15,6,8000 : Bob Off 1 : Wait 50
For F=Y Bob(11) To 250 Step 2 : Bob 11,X Bob(11),F,36 : Wait 1 : Next F
Sam Play 9,6,13000 : Wait 50 : Bob 4,X Bob(11)-6,244,9
Amal 4,A4$ : Amal On 4 : Sam Play 15,4,3000 : Bob Off 11
Ink 11,0 : Text 90,110,"GAME OVER" : Wait 50
End Proc
Procedure HISCORES
For LIN=0 To 9
If SCORE>=HISCORE(LIN)
For G=9 To LIN+1 Step -1
NAME$(G)=NAME$(G-1)
HISCORE(G)=HISCORE(G-1)
Next G
NAME$(LIN)=""
HISCORE(LIN)=SCORE
TABLE
NEWENTRY
Exit
End If
Next LIN
If LIN=10 Then TABLE
End Proc
Procedure TABLE
Screen Hide 1 : Cls 0 : Screen Show 0 : Screen 0
Cls 0 : SKY0 : Mvolume MUSVOL
Paper 0 : Pen 15 : Ink 11,0 : Text 20,45,"Hi Scores"
For G=0 To 9
Locate 12,(G+4)*2
Print Using "#####";HISCORE(G);
Print Space$(9);NAME$(G)
Next G
End Proc
Procedure NEWENTRY
Curs Off : Flash 4,"(000,5)(333,5)(666,5)(999,5)(CCC,5)(FFF,5)"
Clear Key : C=26
Repeat
Locate C,(LIN+4)*2
Pen 4 : Print "_";Chr$(8) : Pen 15
Repeat
N$=Inkey$
If(C=26) and(N$=Chr$(8)) Then N$=""
If(N$<>Chr$(8)) and(N$<>Chr$(13)) and((N$<"a") or(N$>"z")) Then N$=""
Until N$<>""
If N$=Chr$(13)
Locate C,(LIN+4)*2 : Print " "
Exit
End If
If N$=Chr$(8)
Locate C,(LIN+4)*2
Print " "
Dec C
NAME$(LIN)=Left$(NAME$(LIN),C-26)
Else
NAME$(LIN)=NAME$(LIN)+Upper$(N$)
Locate C,(LIN+4)*2
Print Upper$(N$)
Inc C
End If
Until C=36
Flash Off : SAVHISCORES
End Proc
Procedure SAVHISCORES
On Error Proc WRITPROTEC
Resume Label CONTINUE
'
Show On
'
Open Out 1,"df0:hiscores"
For F=0 To 9
Print #1,HISCORE(F) : Print #1,NAME$(F)
Next F
Close 1
Open Out 2,"df0:hiscoresBACKUP"
For F=0 To 9
Print #2,HISCORE(F) : Print #2,NAME$(F)
Next F
Close 2
CONTINUE:
Hide On
End Proc
Procedure WRITPROTEC
Locate 0,31 : Pen 13
Centre "CAN'T SAVE ---- WRITE PROTECTED"
Resume Label
End Proc
Procedure SKY0
Set Rainbow 0,0,450,"(28,-1,1)","(28,1,1)","(28,0,1)"
Rainbow 0,100,40,290
End Proc
Procedure SKY1
Set Rainbow 0,0,450,"(30,0,1)","(30,0,1)","(30,-1,1)"
Rainbow 0,110,40,290
End Proc
Procedure SHUFFLE
For F=1 To 20
A=Rnd(15)+1 : B=Rnd(15)+1
Swap BUILD(A),BUILD(B)
Next F
End Proc
Procedure PAUSE
Amal Freeze
Mvolume 0
Locate 0,5 : Centre "G A M E P A U S E D"
While Inkey$<>" " : Wend
Locate 0,5 : Centre Space$(33)
Amal On
Mvolume MUSVOL
End Proc