home *** CD-ROM | disk | FTP | other *** search
/ Merciful 3 / Merciful_Release_3.bin / software / h / henrys_house / henryshouse1.dms / henryshouse1.adf / SourceCode / Title.Asc < prev   
Text File  |  1993-06-20  |  17KB  |  525 lines

  1. '                                Henry's House 
  2. '
  3. '                           TITLE SCREEN SOURCE CODE 
  4. '
  5. '                          by : Gurmita & Sucha Singh
  6. '
  7. '----------------------------------------------------------------------------- 
  8. ' NOTE:This source code can not be Run through the AMOS editor as some files 
  9. ' need to be copied into memory which is done in the startup-sequence of the 
  10. ' Game(see Intro source code). 
  11. '
  12. ' The following source code loads the scores from Ram which were copied in the 
  13. ' startup-sequence(see Intro source code),displays the main title screen if
  14. ' you hav'nt got onto the scoreboard then flicks between the main title and
  15. ' scoreboard screen until you press fire to start the game. It also checks to
  16. ' see if you have pressed the Spacebar to display the two information screens. 
  17. '
  18. ' Memory Banks used: 
  19. '  7 - Track Mod - Title track 
  20. ' 10 - Pac Pic - Scrolly background picture
  21. ' 11 - Pac Pic - Main title picture
  22. ' 12 - Pac Pic - Scoreboard picture
  23. ' 13 - Pac Pic - Enter Your Name Picture 
  24. ' 14 - Pac Pic - Information 
  25. ' 15 - Pac Pic - More Infomation 
  26. '
  27. ' Variables Used:
  28. ' NOM$()   - Holds 6 names.
  29. ' SCORE$() - Holds 6 scores. 
  30. ' COUNT    - The pause when either the main title and scoreboard pic are shown.
  31. ' SRN      - SRN=0 when the main title is showing or SRN=1 when the scoreboard 
  32. '            is showing.This is so the program can wipe to the picture where 
  33. '            you had pressed the Spacebar to see the info screens. 
  34. '----------------------------------------------------------------------------- 
  35. '
  36. ' Closes the AMOS editor to save memory. 
  37. Close Editor 
  38. '
  39. ' Sets the arrays to hold six names and six scores.
  40. Dim NOM$(5),SCORE(5)
  41. '
  42. ' Makes the variables global so the whole program can access them. 
  43. Global NOM$(),SCORE(),COUNT,SRN
  44. '
  45. ' Sets the variables.
  46. COUNT=1 : SRN=0
  47. '
  48. '----------------------------------------------------------------------------
  49. ' Calls the SETUP procedure. 
  50. _SETUP
  51. '
  52. ' Calls the MAINLOOP procedure.  
  53. _MAINLOOP
  54. '----------------------------------------------------------------------------
  55. '
  56. ' Mainloop which wipes between the main title screen and the scoreboard and
  57. ' checks to see if the Firebutton or Spacebar has been pressed.
  58. Procedure _MAINLOOP
  59.    '
  60.    Do 
  61.       ' Checks to see if the Spacebar has been pressed,if it has,it goes to
  62.       ' the INFO procedure.
  63.       If Key State(64)=True Then _INFO
  64.       '
  65.       ' Checks to see if the Firebutton has been pressed,if it has,it goes to
  66.       ' the START procedure. 
  67.       If Fire(1)=-1 Then _START
  68.       '
  69.       ' Increases the count variable.
  70.       Inc COUNT
  71.       '
  72.       ' If the count variable>250 it is reset,then goes to the HISCORE_DISPLAY 
  73.       ' procedure which shows the Scoreboard.
  74.       If COUNT>250 Then COUNT=0 : HISCORE_DISPLAY
  75.       '
  76.       ' Wait for a vertical blank
  77.       Wait Vbl 
  78.    Loop 
  79.    '
  80. End Proc
  81. '
  82. ' Opens up 6 screens to hold the pictures to be used in the title,loads music
  83. ' and hiscores then checks to see if your score is high enough to be entered.
  84. Procedure _SETUP
  85.    '
  86.    ' Hides away the mouse pointer.
  87.    Hide On 
  88.    '
  89.    ' Tells AMOS to grab the first 6 numbers in the command line as a string.
  90.    S$=Left$(Command Line$,6)
  91.    '
  92.    ' This converts the string in 'S$' to a number variable,SCORE. 
  93.    SCORE=Val(S$)
  94.    '
  95.    ' Opens up 6 screens and hides them.Screen 0 and 1 are used as the dual
  96.    ' playfield screens with 0 as the background and 1 which displays the
  97.    ' various title pictures.
  98.    Screen Open 0,320,400,8,Lowres : Curs Off : Flash Off : Cls 0 : Screen Hide 0
  99.    Screen Open 1,320,200,8,Lowres : Curs Off : Flash Off : Cls 0 : Screen Hide 1
  100.    Screen Open 2,320,200,8,Lowres : Curs Off : Flash Off : Cls 0 : Screen Hide 2
  101.    Screen Open 3,320,200,8,Lowres : Curs Off : Flash Off : Cls 0 : Screen Hide 3
  102.    Screen Open 4,320,200,8,Lowres : Curs Off : Flash Off : Cls 0 : Screen Hide 4
  103.    Screen Open 5,320,200,8,Lowres : Curs Off : Flash Off : Cls 0 : Screen Hide 5
  104.    '
  105.    ' Loads fonts from Disk2.
  106.    Get Disc Fonts 
  107.    '
  108.    ' Uses all the fonts to make sure they have all loaded then clears the screen. 
  109.    Screen 1
  110.    For F=0 To 6
  111.       Set Font F : T$="Amos 12345:"+Str$(F)
  112.       Text 0,0,T$
  113.    Next F
  114.    Cls 0
  115.    '
  116.    ' Loads the powerpacked Title track into bank 7. 
  117.    'Ppload "Henry's_HouseD2:Sound/TitleTrack",7 
  118.    '
  119.    ' Turns on the filter    
  120.    Led Off 
  121.    '
  122.    ' Unpacks the various IFFs to their screens. 
  123.    Unpack 11 To 2 : Screen Hide 2
  124.    Unpack 12 To 3 : Screen Hide 3
  125.    Unpack 14 To 4 : Screen Hide 4
  126.    Unpack 15 To 5 : Screen Hide 5
  127.    '
  128.    ' Sets an array to hold the colour values of a picture.
  129.    Dim C(16)
  130.    '
  131.    ' Unpacks the background screen to screen 0 then sets the display so the 
  132.    ' picture is hidden and changes all the colours to black.
  133.    Unpack 10 To 0 : Screen Display 0,128,50,0,0 : For C=0 To 15 : C(C)=Colour(C) : Colour C,0 : Next 
  134.    '
  135.    ' Sets screen display back to normal size. 
  136.    Screen Display 0,128,50,320,200
  137.    '
  138.    ' Sets the Amal animation for the scrolling background.The picture is 2
  139.    ' screens high so when the top half of the iff has scrolled up its quickly 
  140.    ' sent back down to its starting position then repeats the process.
  141.    Channel 1 To Screen Offset 0
  142.    A$="L:Let Y=Y+1;P;If Y>199 then J R else J L;"
  143.    A$=A$+"R:Let Y=0;J L"
  144.    Amal 1,A$
  145.    '
  146.    ' Calls the HISCORE_LOAD procedure which loads the hiscores from memory. 
  147.    HISCORE_LOAD["RAM:Hiscores.SCR"]
  148.    '
  149.    ' Plays the tracker mod in bank 7 and makes it continualy loop.
  150.    Track Play 7 : Track Loop On 
  151.    '
  152.    ' If your score is higher than the lowest score in the table then it calls 
  153.    ' the HISCORE_ENTER procedure if its lower then it displays then Main title. 
  154.    If SCORE>SCORE(5)
  155.       HISCORE_ENTER[SCORE]
  156.    Else 
  157.       ' Unpacks the main title iff,hides the screen then turns its colours to black. 
  158.       Unpack 11 To 1 : Screen Hide 1 : For C=0 To 15 : C(C)=Colour(C) : Colour C,0 : Next 
  159.       Screen 1
  160.       '
  161.       ' Sets the dual playfield with screen 0 as the background and screen 1 
  162.       ' as the one which displays all the information. 
  163.       Dual Playfield 1,0 : Wait Vbl 
  164.       '
  165.       ' Turns on the scrolly background,shows both the screens and fades them
  166.       ' into view. 
  167.       Amal On 
  168.       Screen Show 0
  169.       Screen Show 1
  170.       Fade 1,$0,$FFF,$9EC,$B7,$FC0,$D91,$B72,$421,$0,$5A,$16B,$17B,$27C,$28D,$39D,$4AE
  171.       Wait 15
  172.    End If 
  173.    '
  174. End Proc
  175. '
  176. ' Displays the scoreboard in the mainloop
  177. Procedure HISCORE_DISPLAY
  178.    '
  179.    ' Sets the SRN variable to 1 then wipes away the main title screen and 
  180.    ' changes the palette to that of the Scoreboard screen.
  181.    SRN=1
  182.    Screen 1
  183.    Proc _SCR_WIPE1[1,0,0,0,0,0,320,200,10,2,0,0,1]
  184.    Palette $0,$FFF,$FD0,$E90,$D40,$C00,$550,$FC,$0,$5A,$16B,$17B,$27C,$28D,$39D,$4AE
  185.    '
  186.    ' Prints the names and scores in the Scoreboard screen which is hidden away. 
  187.    Screen 3
  188.    Ink 1,0,0 : Set Font 4
  189.    For I=0 To 5
  190.       YP=79+I*20
  191.       SCORE$=Mid$(Str$(SCORE(I)),2)
  192.       LS=Text Length(SCORE$)
  193.       Text 85,YP,NOM$(I)
  194.       Text 256-LS,YP,SCORE$
  195.    Next I
  196.    '
  197.    ' Displays screen 3,which has the Scoreboard in it,to screen 1.
  198.    Screen 1
  199.    Proc _SCR_WIPE1[3,1,0,0,0,0,320,200,10,1,0,0,1]
  200.    '
  201.    ' For next loop which acts as a timer for how long the program stays on the
  202.    ' Scoreboard. Also checks for the Spacebar and Firebutton. 
  203.    For COUNT=0 To 250
  204.       If Key State(64)=True Then _INFO
  205.       If Fire(1)=-1 : COUNT=250 : _START : End If 
  206.       Wait Vbl 
  207.    Next COUNT
  208.    '
  209.    ' Variable is reset for the next pause.
  210.    COUNT=0
  211.    '
  212.    ' Wipes away the Scoreboard in screen 1. 
  213.    Proc _SCR_WIPE1[1,0,0,0,0,0,320,200,10,2,0,0,1]
  214.    '
  215.    ' Sets the new palette for the Main Title picture which is then wiped from 
  216.    ' screen 2 to screen 1. Also sets the SRN variable to normal.
  217.    Palette $0,$FFF,$9EC,$B7,$FC0,$D91,$B72,$421,$0,$5A,$16B,$17B,$27C,$28D,$39D,$4AE
  218.    Proc _SCR_WIPE1[2,1,0,0,0,0,320,200,10,1,0,0,1]
  219.    SRN=0
  220.    '
  221.    ' Exit procedure 
  222.    Pop Proc
  223.    '
  224. End Proc
  225. '
  226. ' Asks you to enter your name then saves the new Scoreboard to Ram.
  227. Procedure HISCORE_ENTER[SCORE]
  228.    '
  229.    If SCORE>SCORE(5)
  230.       '
  231.       ' Find the position of our new score in the table
  232.       POS=0
  233.       While SCORE<=SCORE(POS)
  234.          POS=POS+1
  235.       Wend 
  236.       '
  237.       ' Move the lower scores one place down 
  238.       For I=5 To POS+1 Step -1
  239.          NOM$(I)=NOM$(I-1)
  240.          SCORE(I)=SCORE(I-1)
  241.       Next I
  242.       NOM$(POS)=""
  243.       SCORE(POS)=SCORE
  244.       '
  245.       ' Set an array to hold the colours of a screen then unpacks the
  246.       ' hiscore enter iff to screen 1 then changes its colours to black. 
  247.       Dim C(16)
  248.       Unpack 13 To 1 : For C=0 To 15 : C(C)=Colour(C) : Colour C,0 : Next 
  249.       Screen 1
  250.       '
  251.       ' Sets the dual playfield screens and turns on the scrolling background
  252.       ' then fades the two screens into view.
  253.       Dual Playfield 1,0
  254.       Amal On 
  255.       Fade 1,$0,$FFF,$FD0,$E90,$D40,$C00,$550,$FC,$0,$5A,$16B,$17B,$27C,$28D,$39D,$4AE
  256.       Wait 15
  257.       '
  258.       ' Set up Cursor
  259.       Flash 7,"(FFF,30)(666,20)"
  260.       XC=80 : YC=100
  261.       '
  262.       ' Display Cursor 
  263.       Gosub CURSEUR
  264.       '
  265.       ' Set the font to number 5 and the style to bold.
  266.       Set Font 5 : Set Text 2
  267.       '
  268.       ' Input the name using a REPEAT..UNTIL loop
  269.       Repeat 
  270.          ' Read keyboard
  271.          K$=Inkey$
  272.          K=Asc(K$)
  273.          L=Len(NOM$)
  274.          ' Handle Backspace 
  275.          If K=8 and L>0
  276.             DC=0
  277.             XC=XC-15
  278.             Text XC,YC,"  "
  279.             Gosub CURSEUR
  280.             NOM$=Left$(NOM$,L-1)
  281.          End If 
  282.          ' Handle cursor
  283.          If K>13 and L<10
  284.             DC=8
  285.             Ink 1,0 : Text XC,YC,K$
  286.             XC=XC+15
  287.             Gosub CURSEUR
  288.             NOM$=NOM$+K$
  289.          End If 
  290.          '
  291.          ' Repeat until a carriage return.
  292.       Until K=13
  293.       '
  294.       ' Put the new name into the NOM$ array 
  295.       NOM$(POS)=NOM$
  296.       SCORE(POS)=SCORE
  297.       '
  298.       ' Turns the  cursor Flash off and calls the HISCORE_SAVE procedure which 
  299.       ' saves the latest names and scores to Ram.
  300.       Flash Off 
  301.       HISCORE_SAVE["RAM:Hiscores.SCR"]
  302.       '
  303.       ' Wipes away the 'Enter Your Name' iff and changes the  palette to that
  304.       ' of the Scoreboard picture. 
  305.       Proc _SCR_WIPE1[1,0,0,0,0,0,320,200,10,2,0,0,0]
  306.       Palette $0,$FFF,$FD0,$E90,$D40,$C00,$550,$FC,$0,$5A,$16B,$17B,$27C,$28D,$39D,$4AE
  307.       '
  308.    End If 
  309.    '
  310.    ' Prints the new names and scores on the Scoreboard picture which is hidden. 
  311.    Screen 3
  312.    Ink 1,0,0 : Set Font 4
  313.    For I=0 To 5
  314.       YP=79+I*20
  315.       SCORE$=Mid$(Str$(SCORE(I)),2)
  316.       LS=Text Length(SCORE$)
  317.       Text 85,YP,NOM$(I)
  318.       Text 256-LS,YP,SCORE$
  319.    Next I
  320.    '
  321.    ' Displays the updated Scoreboard picture,pauses then wipes it away. 
  322.    Screen 1
  323.    Proc _SCR_WIPE1[3,1,0,0,0,0,320,200,10,1,0,0,0]
  324.    Wait 100
  325.    Proc _SCR_WIPE1[1,0,0,0,0,0,320,200,10,2,0,0,0]
  326.    '
  327.    ' Changes palette to the main title picture then displays it on screen 1.
  328.    Palette $0,$FFF,$9EC,$B7,$FC0,$D91,$B72,$421,$0,$5A,$16B,$17B,$27C,$28D,$39D,$4AE
  329.    Proc _SCR_WIPE1[2,1,0,0,0,0,320,200,10,1,0,0,0]
  330.    '
  331.    ' Exit procedure.
  332.    Pop Proc
  333.    '
  334.    ' Simulate a 'fake' text cursor using the DRAW command 
  335.    CURSEUR:
  336.    Ink 7 : Draw XC,YC+1 To XC+6,YC+1
  337.    Return 
  338.    '
  339. End Proc
  340. '
  341. ' Load a list of scores from "Hiscores.SCR" which is stored in Ram.
  342. Procedure HISCORE_LOAD[N$]
  343.    '
  344.    ' Handle errors
  345.    On Error Goto ERREUR
  346.    '
  347.    ' Open a simple sequential file in Ram.
  348.    Open In 1,"RAM:Hiscores.SCR"
  349.    ' Read the names and scores from the disc
  350.    For I=0 To 5
  351.       Line Input #1,NOM$(I),SCORE$
  352.       SCORE(I)=Val(SCORE$)
  353.    Next I
  354.    ' Close up the file
  355.    Close 1
  356.    '
  357.    SKIP:
  358.    Pop Proc
  359.    '
  360.    ERREUR:
  361.    Resume SKIP
  362.    '
  363. End Proc
  364. '
  365. ' Save the new table in Ram. 
  366. Procedure HISCORE_SAVE[N$]
  367.    '
  368.    ' Handle errors
  369.    On Error Goto HELP
  370.    '
  371.    ' Create a simple sequential file in Ram 
  372.    Open Out 1,"RAM:Hiscores.SCR"
  373.    ' Write the names and scores to the new file 
  374.    For I=0 To 5
  375.       Print #1,NOM$(I)
  376.       Print #1,Str$(SCORE(I))
  377.    Next I
  378.    ' Close the file (ESSENTIAL!)
  379.    Close 1
  380.    '
  381.    SKIP:
  382.    Pop Proc
  383.    '
  384.    HELP:
  385.    Resume SKIP
  386.    '
  387. End Proc
  388. '
  389. ' Shows the two information screens. 
  390. Procedure _INFO
  391.    '
  392.    ' Resets the count variable to 0 and wipes away screen 1 while changing the
  393.    ' palette to that of the info pictures.
  394.    COUNT=0
  395.    Screen 1
  396.    Proc _SCR_WIPE1[1,0,0,0,0,0,320,200,10,2,0,0,1]
  397.    Palette $0,$FFF,$FD0,$E90,$D40,$C00,$550,$FC,$0,$5A,$16B,$17B,$27C,$28D,$39D,$4AE
  398.    '
  399.    ' Displays the first info iff by wiping it from screen 4 to screen 1.
  400.    Proc _SCR_WIPE1[4,1,0,0,0,0,320,200,10,1,0,0,1]
  401.    '
  402.    ' A small loop checks for the Spacebar to be pressed then wipes the screen.
  403.    Repeat 
  404.    Until Key State(64)=True
  405.    Proc _SCR_WIPE1[1,0,0,0,0,0,320,200,10,2,0,0,1]
  406.    '
  407.    ' Displays the secound info iff by wiping it from screen 5 to screen 1 then
  408.    ' a small loop checks for the Spacebar to be pressed then wipes the screen.
  409.    Proc _SCR_WIPE1[5,1,0,0,0,0,320,200,10,1,0,0,1]
  410.    Repeat 
  411.    Until Key State(64)=True
  412.    Proc _SCR_WIPE1[1,0,0,0,0,0,320,200,10,2,0,0,1]
  413.    '
  414.    ' If SRN=0 then it changes the palette and displays the Main Title picture.
  415.    If SRN=0
  416.       Palette $0,$FFF,$9EC,$B7,$FC0,$D91,$B72,$421,$0,$5A,$16B,$17B,$27C,$28D,$39D,$4AE
  417.       Proc _SCR_WIPE1[2,1,0,0,0,0,320,200,10,1,0,0,1]
  418.    End If 
  419.    '
  420.    ' If SRN=1 it displays the Scoreboard picture. 
  421.    If SRN=1
  422.       Proc _SCR_WIPE1[3,1,0,0,0,0,320,200,10,1,0,0,1]
  423.    End If 
  424.    '
  425.    ' Exit procedure.
  426.    Pop Proc
  427.    '
  428. End Proc
  429. '
  430. ' Procedure to wipe one screen to another. 
  431. Procedure _SCR_WIPE1[SW_SOURCE,SW_DEST,SW_XSOURCE,SW_YSOURCE,SW_XDEST,SW_YDEST,SW_WIDTH,SW_HEIGHT,SW_ST,SW_TYPE,SW_BACK,SW_PAUSE,SW_W]
  432.    '
  433.    ' Wipes the screen in a gradual horizontal wipe
  434.    ' Author of wipe routine: Mike Stevens 
  435.    '
  436.    ' Inputs:
  437.    '
  438.    ' SW_SOURCE  - Screen number of the source screen
  439.    ' SW_DEST    - Screen number of the destination screen 
  440.    ' SW_XSOURCE - Top left X coord of area to be wiped, on source screen
  441.    ' SW_YSOURCE - Top left Y coord of area to be wiped, on source screen
  442.    ' SW_XDEST   - Top left X coord of area to be wiped, on destination screen 
  443.    ' SW_YDEST   - Top left Y coord of area to be wiped, on destination screen 
  444.    ' SW_WIDTH   - Width of the area to be wiped (pixels)
  445.    ' SW_HEIGHT  - Height of the area to be wiped (pixels) 
  446.    ' SW_ST      - Number of pixels between each wipe section (step) 
  447.    ' SW_TYPE    - Type of wipe. 1 = Draw images, anything else = Draw colour
  448.    ' SW_BACK    - Colour to wipe to if type <> 1 (colour) 
  449.    ' SW_PAUSE   - 50ths of a second to pause when wiping. 0 = no pause
  450.    ' SW_W       - Use a waitvbl. True = wait vbl, False = no wait vbl 
  451.    '
  452.    ' ************************************************************************ 
  453.    '
  454.    ' Decrease width and height to give correct wipe dimensions. 
  455.    Dec SW_HEIGHT : Dec SW_WIDTH
  456.    '  
  457.    ' This loop increases the difference between two adjoining wipe lines
  458.    ' by one each time to give a smooth gradual effect.
  459.    For SW_Z=0 To SW_ST
  460.       '
  461.       ' This loop creates the actual wipe effect by creating a step from 
  462.       ' the top of the wipe area to the bottom of the wipe area, offset by 
  463.       ' the gradual loop previous
  464.       For SW_Y=SW_YSOURCE+SW_Z To SW_YSOURCE+SW_Z+SW_HEIGHT Step SW_ST
  465.          '      
  466.          ' Draw graphics on the destination screen. 
  467.          If SW_TYPE=1
  468.             ' Picture wipe 
  469.             Screen Copy SW_SOURCE,SW_XSOURCE,SW_Y,SW_XSOURCE+SW_WIDTH+1,Min(SW_Y+1,SW_YSOURCE+SW_HEIGHT+1) To SW_DEST,SW_XDEST,SW_Y-SW_YSOURCE+SW_YDEST
  470.          Else 
  471.             ' Colour wipe
  472.             Cls SW_BACK,SW_XDEST,SW_Y-SW_YSOURCE+SW_YDEST To SW_XDEST+SW_WIDTH+1,Min(SW_Y-SW_YSOURCE+SW_YDEST+1,SW_YDEST+SW_HEIGHT+1)
  473.          End If 
  474.          '        
  475.          ' Create a pause and/or a wait vbl to allow user control of the
  476.          ' speed of wipe. 
  477.          If SW_PAUSE>0 : Wait SW_PAUSE : End If 
  478.          If SW_W=True : Wait Vbl : End If 
  479.          '
  480.          ' End the verticle loop
  481.       Next SW_Y
  482.       '
  483.       ' End the gradual loop 
  484.    Next SW_Z
  485.    '
  486. End Proc
  487. '
  488. ' Sets main variables to be placed in the Command line$ then loads the 
  489. ' Select Level program.
  490. Procedure _START
  491.    '
  492.    ' Set the 4 main variables used in the levels. 
  493.    LIVES=3 : SC=0 : EXSC=0 : LEVEL=0
  494.    '
  495.    ' Create 4 Main strings to hold the above 4 variables. 
  496.    A$="   " : B$="      " : C$="     " : D$="  "
  497.    '
  498.    ' Convert the 4 variables into strings.
  499.    L$=Str$(LIVES) : S$=Str$(SC) : E$=Str$(EXSC) : LEV$=Str$(LEVEL)
  500.    '
  501.    ' Then place those strings into the above Main strings.
  502.    Right$(A$,3)=L$ : Left$(B$,6)=S$ : Right$(C$,5)=E$ : Right$(D$,2)=LEV$
  503.    '
  504.    ' Lastly it places the final 4 strings into the Command Line$ to be passed 
  505.    ' through to the next program. 
  506.    Command Line$=A$+B$+C$+D$
  507.    '
  508.    ' Fades screen 1,stops the music,turns off the filter,turns off the
  509.    ' animation then clears the Key buffer.
  510.    Screen 1 : Fade 1 : Wait 15
  511.    Track Stop : Led On 
  512.    Amal Off : Clear Key 
  513.    '
  514.    ' Closes all the screens opened and erases all the banks to clear memory.
  515.    For S=0 To 5
  516.       Screen Close S
  517.    Next S
  518.    For B=0 To 15
  519.       Erase B
  520.    Next B
  521.    ' Load the next program. 
  522.    Run "HenryGame/SelectLevel"
  523.    '
  524. End Proc
  525.