home *** CD-ROM | disk | FTP | other *** search
/ Merciful 3 / Merciful_Release_3.bin / software / h / henrys_house / henryshouse1.dms / henryshouse1.adf / SourceCode / EndSeq.Asc next >
Text File  |  1993-06-20  |  7KB  |  232 lines

  1. '                                Henry's House 
  2. '
  3. '                           END SEQUENCE 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. ' full Game(see Intro source code).
  11. '
  12. ' The following source code displays the end sequence animation fading between 
  13. ' the 3 scenes and then scrolls the credits into view finally fading the 
  14. ' 'State Of The Art' logo into view. 
  15. '
  16. ' Memory Banks Used: 
  17. '  3 - Music - Endseq Music
  18. ' 10 - Chip Data - First part of sequence
  19. ' 11 - Chip Data - Secound part of sequence
  20. ' 12 - Chip Data - Third part of sequence
  21. ' 13 - Pac Pic - Credit picture
  22. ' 14 - Pac Pic - Insert Disc2 picture
  23. '
  24. ' Variables Used:
  25. ' SC - Your Score. 
  26. ' N  - Total number of frames for an animation.
  27. '
  28. '-----------------------------------------------------------------------------   
  29. '
  30. ' Closes the Amos editor to save memory. 
  31. Close Editor 
  32. '
  33. ' Makes variable Global so the whole program can access it.
  34. Global SC
  35. '
  36. '----------------------------------------------------------------------------- 
  37. 'Calls the ENDSEQ procedure
  38. _ENDSEQ
  39. '
  40. '----------------------------------------------------------------------------- 
  41. '
  42. ' Reseaves the Score and plays the end-sequence animation from memory then 
  43. ' calls the CREDIT and CHANGE_DISK procedures. 
  44. Procedure _ENDSEQ
  45.    '
  46.    ' Reseaves the command line$ then takes the score out of it. 
  47.    S$=Left$(Command Line$,6)
  48.    ' Converts the Score string into a variable. 
  49.    SC=Val(S$)
  50.    '
  51.    ' Opens up screen then hides screen and mouse pointer. 
  52.    Screen Open 0,320,200,16,Lowres : Screen Hide 0
  53.    Curs Off : Flash Off : Cls 0 : Hide On 
  54.    Screen 0
  55.    ' Sets directory to Disk1. 
  56.    Dir$="Henry's_House:"
  57.    '
  58.    '----------------------------  Scene 1 ------------------------------------
  59.    ' Sets the total number of frames in the first Scene.
  60.    N=12
  61.    '
  62.    ' Displays the Screen,sets where the animation is coming from ,Bank 10,
  63.    ' its channel number(1) and screen number(0).  
  64.    Screen Show 0
  65.    P=Frame Play(10,1,0)
  66.    '
  67.    ' Double Buffers the screen so the animation dos'nt flicker. 
  68.    Double Buffer 
  69.    '
  70.    ' For next' loop is used to flick through each frame one at a time with 'N'
  71.    ' holding the total number of Frames and 'X' holding the individual frame
  72.    ' number which increases until it matches 'N' and finishes the loop. 
  73.    For X=2 To N-2
  74.       If X=2 Then Wait 30
  75.       P=Frame Play(P,1)
  76.       Screen Swap 
  77.       Wait Vbl : Wait Vbl : Wait Vbl : Wait Vbl 
  78.    Next X
  79.    '
  80.    ' Pauses on the open door then fades the screen to black.
  81.    Freeze 
  82.    Wait 30
  83.    Fade 1 : Wait 15
  84.    '
  85.    '----------------------------  Scene 2 ------------------------------------
  86.    ' Sets the total number of frames in the secound Scene.
  87.    N=48
  88.    '
  89.    ' Displays the Screen,sets where the animation is coming from ,Bank 11,
  90.    ' its channel number(1) and screen number(0).
  91.    Screen Show 0
  92.    F=Frame Play(11,1,0)
  93.    '
  94.    Double Buffer 
  95.    '
  96.    ' Uses the same method of animation as scene one.
  97.    For X=2 To N-2
  98.       F=Frame Play(F,1)
  99.       Screen Swap 
  100.       Wait Vbl : Wait Vbl : Wait Vbl : Wait Vbl 
  101.    Next X
  102.    '
  103.    ' Pauses on Henry then fades the screen to black.
  104.    Freeze 
  105.    Wait 20
  106.    Fade 1 : Wait 15
  107.    '
  108.    '----------------------------  Scene 3 ------------------------------------
  109.    ' Sets the total number of frames in the third Scene.
  110.    N=30
  111.    '
  112.    ' Displays the Screen,sets where the animation is coming from ,Bank 12,
  113.    ' its channel number(1) and screen number(0).
  114.    Screen Show 0
  115.    R=Frame Play(12,1,0)
  116.    '
  117.    Double Buffer 
  118.    '
  119.    ' Uses the same method of animation as scene one.
  120.    For X=2 To N-2
  121.       If X=2 Then Wait 15
  122.       R=Frame Play(R,1)
  123.       Screen Swap 
  124.       Wait Vbl : Wait Vbl : Wait Vbl : Wait Vbl 
  125.    Next X
  126.    '
  127.    ' Pauses on the open trunk then fades the screen to black. 
  128.    Wait 20
  129.    Fade 2 : Wait 30
  130.    '
  131.    ' Close screen and erase the 3 memory banks which contain the animations.
  132.    Screen Close 0
  133.    Erase 10 : Erase 11 : Erase 12
  134.    '
  135.    ' Calls the relevant procedures. 
  136.    _CREDITS
  137.    _CHANGE_DISC
  138.    '
  139. End Proc
  140. '
  141. ' Scrolls the credits into view then fades the logo into view and waits until
  142. ' you have pressed the Fire button to exit.
  143. Procedure _CREDITS
  144.    '
  145.    ' Play the end-sequence music. 
  146.    Music 1
  147.    Wait 15
  148.    '
  149.    ' Unpack the Credit picture to screen 1,hide it then set the display.
  150.    Unpack 13 To 1 : Screen Hide 1
  151.    Screen Display 1,130,50,320,200
  152.    ' Fade only the logo colours to black. 
  153.    Fade 1,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,,,,,, : Wait 15
  154.    '
  155.    ' Show Credit screen.
  156.    Screen 1
  157.    Screen Show 1
  158.    '
  159.    ' Small Loop which scrolls the screen up then exits. 
  160.    Repeat 
  161.       Inc Y
  162.       Screen Offset 1,0,Y
  163.       Wait Vbl : Wait Vbl 
  164.    Until Y=200
  165.    '
  166.    ' Pause then fade the logo colours to normal making the logo appear. 
  167.    Wait 20
  168.    Fade 2,$0,$8BD,$BDE,$FFF,$6AB,$59A,$379,$268,$156,$46,,,,,,
  169.    '
  170.    ' Small loop which exits once you have pressed the Fire button.
  171.    Repeat 
  172.    Until Fire(1)=-1
  173.    Fade 2 : Wait 30 : Cls 0
  174.    '
  175. End Proc
  176. '
  177. ' Asks for Disk2 then fades the screen,clears the memory and loads the game. 
  178. Procedure _CHANGE_DISC
  179.    '
  180.    ' Unpacks bank 14 to screen 1 then hides screen 1 while fadeing picture to 
  181.    ' black. 
  182.    Unpack 14 To 1 : Screen Hide 1 : Fade 1 : Wait 15
  183.    '
  184.    ' Checks for an error and goes to HELP: if one is detected.
  185.    On Error Goto HELP
  186.    '
  187.    ' Creates an error. This stops the system message popping up.
  188.    Error 86
  189.    '
  190.    ' Sets directory to Disk2 and fades screen 1.
  191.    Dir$="Henry's_HouseD2:"
  192.    Screen 1 : Fade 1 : Wait 15
  193.    '
  194.    ' Prepare a string to hold the score string. 
  195.    A$="      "
  196.    ' Convert the score to a string. 
  197.    S$=Str$(SC)
  198.    ' Place score string into 'A$' then place it in the command line$. 
  199.    Left$(A$,6)=S$
  200.    Command Line$=A$
  201.    '
  202.    ' Closes the screen,erases all banks to clear the memory for next program
  203.    ' then runs the Title program. 
  204.    Screen Close 1
  205.    For B=1 To 15 : Erase B : Next B
  206.    Run "HenryGame/Title"
  207.    '
  208.    HELP:
  209.    '
  210.    ' Small Loop to check if Disk 2 has been inserted.The vaiable 'D' is used
  211.    ' to store a true(-1) or false(0) value. 
  212.    Do 
  213.       ' If Disk2 has been inserted then the dirctory is set to Disk2, D=1 and
  214.       ' exits out of loop. 
  215.       If Exist("Henry's_HouseD2:")=-1 Then Dir$="Henry's_HouseD2:" : D=1 : Exit 
  216.       '
  217.       ' If Disk2 has not been inserted it fades screen 1 into view which asks
  218.       ' you to 'insert Disc2', D=0 and exits out of loop.
  219.       If Exist("Henry's_HouseD2:")=0
  220.          Screen Show 1
  221.          Fade 1,$0,$8BD,$BDE,$FFF,$6AB,$59A,$379,$268,$156,$46,$E52,$E82,$FA3,$FC4,$FE5,$0
  222.          Wait 15
  223.          D=0 : Exit 
  224.       End If 
  225.    Loop 
  226.    '
  227.    ' If D=1 then the program jumps to the line after Error86 and continues,if 
  228.    ' D<>1 ie=0 then the program jumps to Error86 then back to the loop. 
  229.    If D=1 Then Resume Next Else Resume 
  230.    '
  231. End Proc
  232.