Global CURRENT_MENU$,CURRENT_ITEM,HIGH_ITEM,DISKNAME$
BUILD_SCREEN
DATBASE_READ
DEF_MEN_READ
MENU_READER:
DISPLAY_MENU
MOUSE_READER:
CHECK_ICON
Repeat : Until Mouse Click
If Mouse Zone=0 Then Goto MOUSE_READER
If Mouse Zone=CURRENT_ITEM Then Goto MOUSE_READER
If Mouse Zone>HIGH_ITEM and Mouse Zone<9 Then Goto MOUSE_READER
If Mouse Zone<9
CURRENT_ITEM=Mouse Zone
_EXPLODE
DISPLAY_MENU
Goto MOUSE_READER
End If
If Mouse Zone=9
ENTRY_CHECK
Goto MENU_READER
End If
End
'
' This builds the Screen Face.
Procedure BUILD_SCREEN
Cls 0
' paste the space backgroud icon.
Paste Icon 1,98,3
' paste the menu display area icon.
Paste Icon 0,0,2
NUM=0
' paste numeric keypad icon and set zone for mouse
' on the keypad.
Paste Icon 0,119,1
Reserve Zone 9
For A=120 To 160 Step 20
For B=0 To 40 Step 20
Inc NUM
Set Zone NUM,B,A To B+15,A+14
Next B
Next A
' display the menu items index numbers.
Ink 6,15
For A=1 To 8
Text 6,(A-1)*12+9,Right$(Str$(A),1)
Next A
Ink 2,0
Box 100,105 To 300,195
Ink 7,0
Bar 101,106 To 299,194
Ink 5,7 : Text 105,114,"AMONER No 5/ 10-OCT-1992"
Draw 105,116 To 296,116
Text 105,126,"Editor: Gal-on Broner"
Text 105,136,"Assistant Editor:"
Text 105,145," Michael Cox"
Text 105,163,"Distributor:"
Text 105,173," Eric Askilsrud"
Ink 2,0 : Box 420,105 To 620,195
Ink 7,0 : Bar 421,106 To 619,194
' put the spaceship bob.
Bob 1,350,105,1
' program an amal procedure for spaceship bob.
Channel 1 To Bob 1
Amal 1,"Loop: For R0=105 To 180 ; Let Y=Y+1 ; Let RX=X ; Let RY=Y ; Next R0 ; For R0=105 To 180 ; Let Y=Y-1 ; Let RX=X ; Let RY=Y ; Next R0 ; Jump Loop "
Amal On 1
End Proc
' This reads the files database from the disk.
Procedure DATBASE_READ
Open Random 1,DISKNAME$+"files.db"
Field 1,8 As MEN$,72 As DESC$,1 As TYPE$,20 As NAME$
For LOO=1 To 40
Get 1,LOO
MEN$(LOO)=MEN$
DESC$(LOO)=DESC$
TYPE$(LOO)=TYPE$
NAME$(LOO)=NAME$
Next LOO
Close 1
End Proc
' This reads menu information from the disk.
Procedure DEF_MEN_READ
Open In 1,DISKNAME$+"menu.def"
Input #1,CURRENT_MENU$
Input #1,CURRENT_ITEM
Close 1
End Proc
' This routine shoots a bullet to the mouse zone.
Procedure _EXPLODE
' First we get the location of the spaceship.
SPACEX=Amreg(23)-8
SPACEY=Amreg(24)+5
Bob 2,SPACEX,SPACEY,2
' Program an amal routine for the shoot.
Shoot
Channel 2 To Bob 2
Amal 2,"Move XS(0,XM)-X,YS(0,YM)-Y,32"
Amal On 2
Wait Vbl
While Chanmv(2) : Wend
' When movment finish - explode.
Boom
Amal 2,"Anim 1,(3,10)(4,10)(5,10)(5,10)"
Amal On 2
Wait Vbl
While Chanan(2) : Wend
Bob Off 2
End Proc
' This display the menu.
Procedure DISPLAY_MENU
SIZE=Len(CURRENT_MENU$)
PLACE=0
For LOO=1 To 40
If Left$(MEN$(LOO),SIZE)=CURRENT_MENU$
If PLACE+1=CURRENT_ITEM
Ink 4,15
Else
Ink 2,15
End If
Text 26,PLACE*12+9,DESC$(LOO)
Inc PLACE
End If
Next LOO
HIGH_ITEM=PLACE
End Proc
' what icon to display?
Procedure CHECK_ICON
If((CURRENT_MENU$="biteme") or(CURRENT_MENU$="main" and CURRENT_ITEM=3))
Paste Icon 421,107,5
Else
If(CURRENT_MENU$="main" and(CURRENT_ITEM=5 or CURRENT_ITEM=6))
Paste Icon 421,107,6
Else
Paste Icon 421,107,4
End If
End If
Ink 2,0 : Box 420,105 To 620,195
Ink 7,15
End Proc
' This cleans up the menu.
Procedure CLEAN_MENU
Ink 15
CLEAN$=Space$(72)
For PLACE=0 To 7
Text 26,PLACE*12+9,CLEAN$
Next PLACE
End Proc
' Now come the most importent procedure.
' This check the entry.
Procedure ENTRY_CHECK
SIZE=Len(CURRENT_MENU$)
PLACE=1
ENTRY_TYPE$="" : Rem The entry type.
ENTRY_NAME$="" : Rem the entry name.
Rem
Rem this loop gets the entry name and type.
Rem
For LOO=1 To 40
If Left$(MEN$(LOO),SIZE)=CURRENT_MENU$
If PLACE=CURRENT_ITEM
ENTRY_TYPE$=TYPE$(LOO)
ENTRY_NAME$=NAME$(LOO)
Goto ENTRY_FOUND
End If
Inc PLACE
End If
Next LOO
ENTRY_FOUND:
Rem
Rem Trip off the spaces in the entry_name$
Rem
For LOO=1 To Len(ENTRY_NAME$)
If Mid$(ENTRY_NAME$,LOO,1)=" "
ENTRY_NAME$=Left$(ENTRY_NAME$,LOO-1)
Goto ENTRY_TRIMED
End If
Next LOO
' End
ENTRY_TRIMED:
Rem
Rem M type items are menus
Rem
If ENTRY_TYPE$="m"
CURRENT_MENU$=ENTRY_NAME$
CURRENT_ITEM=1
CLEAN_MENU
Pop Proc
End If
' Ok.... Since this is either run or print on screen we need to clear some memory.
Bob Off : Wait Vbl : Erase 1 : Erase 2 : Default : Cls 0
Rem
Rem P type are to print on screen using Amore.
Rem
If ENTRY_TYPE$="p"
BUILD_AMORE_FILE[ENTRY_NAME$]
BUILD_MENU_FILE
Run DISKNAME$+"Amore.Amos"
End If
Rem
Rem and R type to run
Rem
If ENTRY_TYPE$="r"
BUILD_MENU_FILE
Run DISKNAME$+ENTRY_NAME$
End If
End Proc
' This buils proper data file for Amore.
Procedure BUILD_AMORE_FILE[FILENAME$]
Open Out 1,DISKNAME$+"Editor/Filename.dat"
Print #1,FILENAME$
Close 1
End Proc
' And last, this file keeps the menu and item area.