home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
126-150
/
apd137
/
autoexec.amos
/
autoexec.amosSourceCode
Wrap
AMOS Source Code
|
1990-08-11
|
6KB
|
301 lines
' This Program is SHAREWARE
' If you would like to receive updates etc.
' Please send five pounds registration fee to
' D. Ramsey, 2 The Paddocks, Haddenham< Bucks. HP17 8AG. ThankYou
On Error Goto HELP
Break Off
Screen Open 0,320,256,2,Lowres : Cls 0 : Hide On
Curs Off : GAME=1 : Dir$="df0:" : LEVEL=1 :
Load "music.abk" : Music 1
LL:
Dim TILE(5,5),NAME$(6),HISCORE(6)
For T=1 To 5 : Read NAME$(T),HISCORE(T) : Next
Data "AMOS",3500,"MANDARIN",3000,"PIXEL",500,"PRECISON",200,"SOFTWARE",100
Screen Open 1,320,20,2,Lowres : Cls 0 : Screen Display 1,,150,,
Flash Off :
Palette 0,$111,$222,$333,$444,$555,$666,$777,$888,$999,$AAA,$BBB,$CCC,$DDD,$EEE,$FFF
TXT$=" Dom Ramsey Presents"
Gosub FADTXT
TXT$=" A Pixel Precision Production"
Gosub FADTXT
LLL:
Hide On : Gosub TITLE : SCORE=0
LLLL:
GAME$=Right$(Str$(GAME),1)
GAME$="screen"+GAME$+".iff"
Load Iff GAME$,0
Double Buffer : Screen Hide 0
MNS=0 : SECS=0 : Inc LEVEL
C=0
For Y=0 To 4
For X=0 To 4
Inc C
Get Bob 0,C,(X*40)+14,(Y*40)+46 To(X*40)+55,(Y*40)+87
Next X
Next Y
Get Bob 0,26,244,191 To 293,240
M:
C=1
For Y=0 To 4
For X=0 To 4
TILE(X,Y)=C
Inc C
Next X
Next Y
Limit Mouse 143,89 To 340,286
'
'Main loop
'
GOES=0
Gosub MESSBOARD
Ink 31,22 : LEVEL$=Str$(LEVEL-1) : LEVEL$=Right$(LEVEL$,Len(LEVEL$)-1)
LEVEL$=String$("0",3-Len(LEVEL$))+LEVEL$ : Text 255,98,LEVEL$
Timer=0
L:
Gosub GTMOVE
Gosub CHKMOVE
If NOMOVED=1 Then Goto L
Gosub MOVETILE
Gosub CHKDONE
Goto L
'
'
'
End
'
FADTXT:
Ink 1,0
For T=0 To 15 : Colour 1,(16*16*T)+(16*T)+T : Wait Vbl : Text 1,10,TXT$ : Wait 4 : Next T
Wait 5
For T=15 To 0 Step -1 : Colour 1,(16*16*T)+(16*T)+T : Wait Vbl : Text 1,10,TXT$ : Wait 4 : Next T
Wait 20
Return
'
GTMOVE:
Show On
While Mouse Key=0
X=X Screen(X Mouse)-14
Y=Y Screen(Y Mouse)-46
T=Timer/50 : MNS=T/60 : SECS=T-(MNS*60) : SEC$=Str$(SECS)
If Len(SEC$)=2 Then SEC$="0"+Right$(SEC$,1) Else SEC$=Right$(SEC$,2)
T$=Str$(MNS)+":"+SEC$
Ink 31,22 : Text 244,138,T$
If MNS=3 Then Goto TIMEUP
Wend
Hide On
X=X/40 : Y=Y/40
Return
'
CHKMOVE:
RT=0 : LT=0 : UP=0 : DN=0 : NOMOVED=0
Gosub CHKUP
Gosub CHKDN
Gosub CHKRT
Gosub CHKLT
If(LT=0 and RT=0 and UP=0 and DN=0) Then NOMOVED=1
If NOMOVED=0 Then GOES=GOES+1
Return
'
CHKUP:
If Y=0 Then Return
If TILE(X,Y-1)=1 Then UP=1
Return
'
CHKDN:
If Y=4 Then Return
If TILE(X,Y+1)=1 Then DN=1
Return
'
CHKLT:
If X=0 Then Return
If TILE(X-1,Y)=1 Then LT=1
Return
'
CHKRT:
If X=4 Then Return
If TILE(X+1,Y)=1 Then RT=1
Return
'
'
MOVETILE:
If UP=1 Then Gosub MVUP
If DN=1 Then Gosub MVDN
If RT=1 Then Gosub MVRT
If LT=1 Then Gosub MVLT
Return
'
MVUP:
Paste Bob(X*40)+14,(Y*40)+46,1
For YY=0 To 39
Wait Vbl
Bob 1,(X*40)+14,(Y*40)+46-YY,TILE(X,Y)
Next YY
Shoot
Paste Bob(X*40)+14,((Y-1)*40)+46,TILE(X,Y)
Bob Off
TILE(X,Y-1)=TILE(X,Y) : TILE(X,Y)=1
Return
'
MVLT:
Paste Bob(X*40)+14,(Y*40)+46,1
For XX=0 To 39
Wait Vbl
Bob 1,(X*40)+14-XX,(Y*40)+46,TILE(X,Y)
Next XX
Shoot
Paste Bob((X-1)*40)+14,(Y*40)+46,TILE(X,Y)
Bob Off
TILE(X-1,Y)=TILE(X,Y) : TILE(X,Y)=1
Return
'
MVRT:
Paste Bob(X*40)+14,(Y*40)+46,1
For XX=0 To 39
Wait Vbl
Bob 1,(X*40)+14+XX,(Y*40)+46,TILE(X,Y)
Next XX
Shoot
Paste Bob((X+1)*40)+14,(Y*40)+46,TILE(X,Y)
Bob Off
TILE(X+1,Y)=TILE(X,Y) : TILE(X,Y)=1
Return
'
MVDN:
Paste Bob(X*40)+14,(Y*40)+46,1
For YY=0 To 39
Wait Vbl
Bob 1,(X*40)+14,(Y*40)+46+YY,TILE(X,Y)
Next YY
Shoot
Paste Bob(X*40)+14,(Y*40)+46+YY,TILE(X,Y)
Bob Off
TILE(X,Y+1)=TILE(X,Y) : TILE(X,Y)=1
Return
'
'
MESSBOARD:
For M=1 To(15+(7*LEVEL))
LP:
X=Rnd(4) : Y=Rnd(4)
Gosub CHKMOVE
If NOMOVED=1 Then Goto LP
If DN=1 Then TILE(X,Y+1)=TILE(X,Y) : TILE(X,Y)=1
If RT=1 Then TILE(X+1,Y)=TILE(X,Y) : TILE(X,Y)=1
If LT=1 Then TILE(X-1,Y)=TILE(X,Y) : TILE(X,Y)=1
If UP=1 Then TILE(X,Y-1)=TILE(X,Y) : TILE(X,Y)=1
Next
C=0
For Y=0 To 4
For X=0 To 4
Inc C
Paste Bob(X*40)+14,(Y*40)+46,TILE(X,Y)
Next X
Next Y
Gosub VOLDOWN
Screen Show 0
Return
'
CHKDONE:
C=0
For Y=0 To 4
For X=0 To 4
Inc C : If TILE(X,Y)<>C Then Return
Next X
Next Y
Gosub VOLUP
S=Timer/50 : S=(300-S)*5
S=(SCORE+S-(3*GOES)+(3*LEVEL))/5 : S=S*2 : SCORE=SCORE+S
If SCORE<0 Then SCORE=0
Load "Congrats.abk",7 : Unpack 7 To 1 : Screen Display 1,,320,, : Erase 7
Ink 1,6 : Text 190,66,Str$(SCORE)
Ink 1,7
SECS=60-SECS : SEC$=Str$(SECS)
SEC$=Right$(SEC$,Len(SEC$)-1) : If Len(SEC$)=1 Then SEC$="0"+SEC$
T$=Str$(2-MNS)+":"+SEC$
Text 50,48,T$
For Y=300 To 120 Step -2
Wait Vbl
Screen Display 1,,Y,,
Next
Screen 0 : Fade 12
GOES=0 : Wait 150 : Add GAME,1,1 To 10
Goto LLLL
Return
'
'
TIMEUP:
Hide On
Gosub VOLUP
SCORE=SCORE+(3*LEVEL)
If SCORE<10 Then SCORE=0
Load "BadLuck.abk",7 : Unpack 7 To 1 : Screen Display 1,,320,,
Erase 7
Ink 1,6 : Text 190,74,Str$(SCORE)
For Y=300 To 120 Step -2
Wait Vbl : Screen Display 1,,Y,,
Next
Gosub CHKHISCORE
Screen 0 : Fade 12 : Wait 350 : Screen 1 : GAME=1 : LEVEL=1
Goto LLL
'
TITLE:
Screen Hide 0
Load Iff "titlescreen.Iff",0
Screen Display 0,,320,,
For Y=320 To 42 Step -4
Wait Vbl
Screen Display 0,,Y,,
Next
Wait 10 : Load "Hiscoretable.abk",7
Unpack 7 To 1 : Screen Display 1,,320,, : SD=319 : SDX=-1
Ink 6,3 : Erase 7 : For T=1 To 5 : S=15-Len(NAME$(T))
T$=Str$(T)+" "+NAME$(T)+String$(".",S)+Str$(HISCORE(T))
Text 50,40+(10*T),T$
Next T
While Mouse Key=0
Add SD,SDX,30 To 320
Wait Vbl
Screen Display 1,,SD,,
If SD=320 or SD=30 Then SDX=-SDX
Wend : Screen 0 : Fade 4
For Y=SD To 320 : Wait Vbl : Screen Display 1,,Y,, : Next
Screen 1 : Cls 0
Return
'
VOLDOWN:
For MV=63 To 0 Step -1 : Wait Vbl : Mvolume MV : Next
Return
VOLUP:
For MV=0 To 63 : Wait Vbl : Mvolume MV : Next
Return
'
'
CHKHISCORE:
For T=1 To 5
If SCORE=>HISCORE(T)
If T=5
HISCORE(5)=SCORE : Gosub GTNAME : Return
End If
For S=5 To T Step -1
HISCORE(S)=HISCORE(S-1) : NAME$(S)=NAME$(S-1)
Next S
Gosub GTNAME : Return
End If
Next T
Return
'
GTNAME:
Hide On
Screen Open 2,320,20,2,Lowres : Screen Display 2,,320,,
Paper 0 : Colour 1,$FFF : Pen 1 : Print " ENTER YOUR NAME (MAX 10 LETTERS)"
For SD=320 To 98 Step -2 : Wait Vbl : Screen Display 2,,SD,, : Next
Locate 10,1
Input NAME$(T)
If Len(NAME$(T))>10 Then NAME$(T)=Left$(NAME$(T),10)
NAME$(T)=Upper$(NAME$(T))
HISCORE(T)=SCORE
For SD=98 To 320 Step 2 : Wait Vbl : Screen Display 2,,SD,, : Next
Return
'
HELP:
Resume