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

  1. '                                Henry's House 
  2. '
  3. '                            LEVEL ONE 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 reseaves the Main variables LIVES,SC,EXSC and
  13. ' LEVEL.It then asks you to 'Press Fire' on the loading screen and then starts 
  14. ' the Level. 
  15. '
  16. ' Memory Banks Used: 
  17. '  1 - Sprites - Sprites 
  18. '  5 - Sound - Main samples
  19. '  6 - Sound - In Game samples 
  20. '  9 - Pac Pic - Control panel 
  21. ' 10 - Pac Pic - Background picture
  22. ' 11 - Pac Pic - Bonus screen background 
  23. '
  24. ' Bobs and Sprites used: 
  25. ' Bob 1 - Fish 
  26. ' Bob 2 - Squirral 
  27. ' Bob 3 - Bird 
  28. ' Bob 5 - Bonus Entrance 
  29. ' Bob 10 - Henry Crying
  30. ' Bob 26 - Henry Hit 
  31. ' Sprite 8 - Player
  32. ' Sprite 10 - Snail
  33. ' Sprite 12 to 23 - Items
  34. ' Sprite 24 - Exit 
  35. '
  36. ' Variables Used:
  37. ' X     - Player sprites x coordinates.
  38. ' Y     - Player sprites y coordinates.
  39. ' I     - Player sprite Image. 
  40. ' D     - Start direction image for player.
  41. ' A     - The number of items you have collected.
  42. ' F     - The platform colour which you collide with.
  43. ' N     - The current height of Henry when jumping.
  44. ' SC    - Your current score.
  45. ' EXSC  - Increases with your score but gets set to 0 if it equals 2000 when 
  46. '         you get an extra life. 
  47. ' LEVEL - The level number which effects the images of the doors.
  48. ' LIVES - Number of lives Henry has. 
  49. ' BONUS - BONUS=1 when you're in the normal level or BONUS=0 when you enter
  50. '         the bonus stage. 
  51. ' BLINK - Time taken for player to start blinking if left alone. 
  52. ' TIME  - The level time limit.
  53. ' COUNT - Used to slow down the time.
  54. ' SPLASH- Activates the drowning sequence. 
  55. ' CROW  - Timer for the Crow sfx.
  56. ' GONG  - Timer for the Gong sfx.
  57. '
  58. '----------------------------------------------------------------------------- 
  59. '
  60. ' Closes the AMOS editor to save memory. 
  61. Close Editor 
  62. '
  63. ' Makes the variables global so the whole program can access them. 
  64. Global X,Y,I,D,A,F,N,SC,EXSC,LEVEL,LIVES,BONUS,BLINK,TIME,COUNT,SPLASH,CROW,GONG
  65. '
  66. 'Sets the variables
  67. X=310 : Y=184 : I=1 : D=0 : A=0 : BONUS=1 : BLINK=0 : TIME=70 : COUNT=0
  68. CROW=0 : SPLASH=0 : GONG=70
  69. '
  70. '----------------------------------------------------------------------------- 
  71. ' Calls the SETUP procedure. 
  72. _SETUP
  73. '
  74. ' Creates a mask for the sprites,sets Autoback to manual,turns off the 
  75. ' automatic updating and updates every 2 vertical blank periods to make the
  76. ' Amal animations smoother.
  77. Make Mask : Autoback 0 : Update Off : Update Every 2
  78. '
  79. '----------------------------------------------------------------------------- 
  80. ' Calls the BLINK procedure. 
  81. _BLINK
  82. '
  83. ' Calls the MAINLOOP procedure.
  84. _MAINLOOP
  85. '----------------------------------------------------------------------------- 
  86. '
  87. ' Uses Screen Swap which updates everything at once so making the Game run 
  88. ' faster.Updates the timer,checks for collisions,the joystic,the platforms and 
  89. ' the soundfx. 
  90. Procedure _MAINLOOP
  91.    '
  92.    ' Manualy updates all the bobs so there is no flicker at the start.
  93.    Bob Clear : Bob Draw 
  94.    '
  95.    ' The loop is divided into two parts. The first is used to perform the 
  96.    ' various instructions in your program and the secound part repeats the
  97.    ' above contents.This keeps the loop in sync.
  98.    Do 
  99.       ' Swaps between the Phisical and Logical screens then clears the screen
  100.       ' of bobs. 
  101.       Screen Swap 0
  102.       Wait Vbl 
  103.       Bob Clear 
  104.       '
  105.       ' Calls the TIME and EXTRA LIFE procedures and sets the Joystic. 
  106.       _TIME
  107.       _EXTRA_LIFE
  108.       J=Joy(1)
  109.       '
  110.       ' Checks the collision between the player sprite and other bobs and sprites. 
  111.       If Spritebob Col(8,1 To 2) Then _DEAD
  112.       If Sprite Col(8,10 To 10) Then _DEAD
  113.       If Sprite Col(8,12 To 23) Then _GET_ITEM
  114.       If Sprite Col(8,24 To 24) Then _EXIT
  115.       '
  116.       ' Places the next wave of itmes. 
  117.       If A=7 Then MORE_ITEMS
  118.       '
  119.       ' Places the Exit on screen when you have collected all the items. 
  120.       If A=15 : Sprite 24,150,66,85 : A=16 : End If 
  121.       '
  122.       ' If you have collected everything in the time limit the entrance to the 
  123.       ' bonus stage opens. 
  124.       If A=16 and TIME>0 : Bob 5,283,113,83 : TIME=0 : End If 
  125.       '
  126.       ' Checks for the joystic and floor,so if Henry is left alone on a
  127.       ' platform the variable 'BLINK' increases or else it equals 0. 
  128.       If J=0 and F=2 Then Inc BLINK Else BLINK=0
  129.       If BLINK>20 Then _BLINK
  130.       '
  131.       ' Checks Left & Right joystic directions.If the joystic has been moved 
  132.       ' and Henry is away from the edge then he will either move left or right.
  133.       ' The variable D sets the starting frame depending on the joystic direction
  134.       ' you have moved.It then adds the frames to make Henry look like he's walking. 
  135.       If J=4 and X>138 Then Dec X : _TIME : D=6 : Inc C : If C mod 4=0 Then Add I,1,1 To 6
  136.       If J=8 and X<438 Then Inc X : _TIME : D=0 : Inc C : If C mod 4=0 Then Add I,1,1 To 6
  137.       '
  138.       ' Checks for Up,Up left and Up right directions.If the joystic has been
  139.       ' moved in either of the up directions and Henry is on the platform then 
  140.       ' the relevant JUMP procedure is called. 
  141.       If J=1 and F=2 Then JUMP_UP
  142.       If J=5 and F=2 Then D=6 : JUMP_LEFT
  143.       If J=9 and F=2 Then D=0 : JUMP_RIGHT
  144.       '
  145.       ' If Henry on the same level as the pond then it activates the splash. 
  146.       If Y Sprite(8)>232 Then SPLASH=1 : _DEAD
  147.       '
  148.       ' Plays the Splosh sfx when the Fish is coming out and going into the
  149.       ' water and plays the Gong sfx when the Gong timer equals 0. 
  150.       If I Bob(1)=19 or I Bob(1)=29 Then Sam Bank 6 : Sam Play %1,1
  151.       If GONG=0 Then Sam Bank 5 : Sam Play %1110,3 : GONG=70
  152.       '
  153.       ' Checks for a collision between a colour on screen and the player sprite. 
  154.       F=Point(X Screen(X Sprite(8)),Y Screen(Y Sprite(8)))
  155.       '
  156.       ' If the colour is not equal to 2(the platform colour) then Henry will fall. 
  157.       If F<>2 Then Inc Y
  158.       '
  159.       ' Updates the player sprite and draws all the bobs on screen.
  160.       Sprite 8,X,Y,I+D
  161.       Sprite Update 
  162.       Bob Draw 
  163.       '
  164.       '----------------------------------------------------------------------- 
  165.       ' Swaps between the Phisical and Logical screens then clears the screen
  166.       ' of bobs. 
  167.       Screen Swap 0
  168.       Wait Vbl 
  169.       Bob Clear 
  170.       J=Joy(1)
  171.       '
  172.       ' Checks for the joystic.By repeating it again it makes Henry walk faster. 
  173.       If J=4 and X>138 Then Dec X : D=6 : Inc C : If C mod 4=0 Then Add I,1,1 To 6
  174.       If J=8 and X<438 Then Inc X : D=0 : Inc C : If C mod 4=0 Then Add I,1,1 To 6
  175.       If Y Sprite(8)>232 Then SPLASH=1 : _DEAD
  176.       If I Bob(1)=19 or I Bob(1)=29 Then Sam Bank 6 : Sam Play %1,1
  177.       '
  178.       ' Checks for the collision between Henry and the platforms.
  179.       F=Point(X Screen(X Sprite(8)),Y Screen(Y Sprite(8)))
  180.       If F<>2 Then Inc Y
  181.       '
  182.       ' Updates the player sprite and draws the bobs on screen.
  183.       Sprite 8,X,Y,I+D
  184.       Sprite Update 
  185.       Bob Draw 
  186.    Loop 
  187.    '
  188. End Proc
  189. '
  190. ' Opens up a screen,sets the fonts,reseaves the variables from the last
  191. ' program then loads the bobs and sfx and waits until you have pressed fire
  192. ' on the loading screen to start the game. 
  193. Procedure _SETUP
  194.    '
  195.    ' Hides mouse pointer,opens screen 0 and screen 2 then hides them both.
  196.    Hide On 
  197.    Screen Open 0,320,200,32,Lowres : Screen Hide 0
  198.    Curs Off : Flash Off : Cls 0
  199.    Screen Open 2,320,30,16,Lowres : Screen Hide 2
  200.    Curs Off : Flash Off : Cls 0
  201.    '
  202.    ' Loads fonts from Disk2 then checks all fonts to make sure they have loaded.
  203.    Get Disc Fonts 
  204.    Screen 2
  205.    For F=0 To 6
  206.       Set Font F : T$="Amos 12345:"+Str$(F)
  207.       Text 0,0,T$
  208.    Next F
  209.    Cls 0
  210.    '
  211.    ' Unpacks the Control Panel to screen 2 hides it,fades it to black then
  212.    ' sets its display.
  213.    Unpack 9 To 2 : Screen Hide 2 : Fade 1 : Wait 15
  214.    Screen Display 2,130,252,320,30
  215.    '
  216.    ' Reseaves the command line$ then separates its contents into the 4 strings. 
  217.    Set Font 6
  218.    B$=Left$(Command Line$,3)
  219.    C$=Mid$(Command Line$,4,6)
  220.    D$=Mid$(Command Line$,10,5)
  221.    E$=Right$(Command Line$,1)
  222.    '
  223.    ' Converts the 4 strings into variables. 
  224.    LIVES=Val(B$) : SC=Val(C$) : EXSC=Val(D$) : LEVEL=Val(E$)
  225.    '
  226.    ' Prints the Lives,Score and Time onto the control panel.
  227.    If LIVES<10 Then Ink 2,0 : Text 39,20,B$ : Text 144,20,C$
  228.    If LIVES>9 Then Ink 2,0 : Text 27,20,B$ : Text 144,20,C$
  229.    Ink 2,0 : Text 278,20,"80"
  230.    '
  231.    ' Loads the powerpacked bobs and sfx.
  232.    Screen 0
  233.    'Ppload "Henry's_HouseD2:Bobs/SpritesLev1" 
  234.    'Ppload "Henry's_HouseD2:sound/Mainsfx",5
  235.    '
  236.    ' Display message 'Press Fire To Start'. 
  237.    Screen 1 : Paste Bob 115,180,91
  238.    '
  239.    ' Small loop which keeps you at the loading screen until you press Fire. 
  240.    Do 
  241.       J=Joy(1)
  242.       If Fire(1)=-1 Then Exit 
  243.       Paste Bob 115,180,91 : Bob Update 
  244.       Wait Vbl 
  245.    Loop 
  246.    ' Small loop which repeats until you have released the fire button then
  247.    ' fades the screen and closes it.
  248.    Repeat 
  249.    Until Fire(1)=0
  250.    Screen 1 : Fade 1 : Wait 15 : Screen Close 1
  251.    '
  252.    ' Unpacks the background to screen 0,hides it then gets the sprite palette 
  253.    ' and Double Buffers the screen for no flicker.
  254.    Screen 0 : Unpack 10 To 0 : Screen Hide 0
  255.    Get Sprite Palette : Double Buffer 
  256.    '
  257.    ' Sets the hot spot to bottom centre for the Player Images,covers up the 
  258.    ' hole in the tree and calls AMAL and ITEMS procedure. 
  259.    For N=1 To 12 : Hot Spot N,$12 : Next 
  260.    Paste Bob 272,96,82
  261.    _AMAL
  262.    _ITEMS
  263.    '
  264.    ' Fades background to black then fades the Control Panel and Background
  265.    ' picture into view. 
  266.    Fade 1 : Wait 15
  267.    Screen 2
  268.    Screen Show 2
  269.    Fade 1,$0,$BBB,$FFF,$EB0,$E90,$FD0,$B70,$840,$520,$CF,$6E,$F7E,$F0,$A01,$D01,$EC8
  270.    Wait 15
  271.    Screen 0
  272.    Screen Show 0
  273.    Fade 1,$34,$BBB,$340,$5A,$7C,$555,$A60,$951,$632,$422,$51,$61,$72,$92,$A3,$B4,$34,$0,$888,$FFF,$520,$840,$B70,$FB0,$486,$5A8,$5CA,$8E,$8,$A01,$D01,$EC8
  274.    Wait 15
  275.    '
  276.    ' Sets the volume for all channels to maximum. 
  277.    Volume %1111,63
  278.    '
  279. End Proc
  280. '
  281. ' Updates the Time.
  282. Procedure _TIME
  283.    '
  284.    ' As long as the time is greater than 0 then the variable,to slow down the 
  285.    ' timer,can keep on increasing.
  286.    If TIME>0 Then Inc COUNT
  287.    '
  288.    ' Adds 1 to the TIME variable and decreases the GONG variable whenever COUNT=50. 
  289.    If COUNT>50
  290.       TIME=TIME-1 : Dec GONG : COUNT=0
  291.       ' Convert TIME variable to a string so it can be printed using 'Text'. 
  292.       A$=Str$(TIME)
  293.       Screen 2 : L=Text Length(A$) : Text 304-L,20,A$
  294.    End If 
  295.    '
  296.    ' Returns program back to screen 0.
  297.    If BONUS=1 Then Screen 0
  298.    '
  299. End Proc
  300. '
  301. ' Updates the lives,sets the death animation then plays it until its finished. 
  302. Procedure _DEAD
  303.    '
  304.    ' Decrease the LIVES by 1,convert variable into a string to display your lives.
  305.    Screen 2
  306.    LIVES=LIVES-1
  307.    B$=Str$(LIVES) : LD=Text Length(B$) : Text 64-LD,20,B$
  308.    '
  309.    Screen 0
  310.    If SPLASH=0
  311.       ' Match the Bob starting position with the Player sprite position. 
  312.       DX=X Screen(X Sprite(8)) : DY=Y Screen(Y Sprite(8))
  313.       Bob 26,DX,DY,87
  314.       ' Set Amal animation.
  315.       Channel 5 To Bob 26
  316.       E$="A 0,(87,0); M 0,-20,20; M 0,-4,4; M 0,-3,3; M 0,-3,4; M 0,2,4; M 0,3,3; M 0,15,5; M 0,250,46"
  317.       Amal 5,E$ : Amal On 5
  318.       ' Turn off player sprite,play Ouch sfx and update bobs.
  319.       Sprite Off 8
  320.       Sam Bank 5 : Sam Play %1110,2
  321.       Bob Clear : Bob Draw 
  322.    End If 
  323.    '
  324.    If SPLASH=1
  325.       ' Match the Bob starting position with the Player sprite position. 
  326.       DX=X Screen(X Sprite(8)) : DY=Y Screen(Y Sprite(8))
  327.       Bob 26,DX,DY,90
  328.       ' Turn off player sprite,play Ouch sfx and update bobs.
  329.       Sprite Off 8
  330.       Sam Bank 6 : Sam Play %1110,2
  331.       Bob Clear : Bob Draw 
  332.    End If 
  333.    '    
  334.    ' Small loop to allow Henry to finish death sequence without causing any 
  335.    ' problems to the main loop eg,colliding while still playing the death anim. 
  336.    Repeat 
  337.       Screen Swap 0
  338.       Wait Vbl 
  339.       Bob Clear 
  340.       _TIME
  341.       If BONUS=1 Then FISH=I Bob(1) : If FISH=19 or FISH=29 Then Sam Bank 6 : Sam Play %1,1
  342.       If GONG=0 Then Sam Bank 5 : Sam Play %1110,3 : GONG=70
  343.       '
  344.       ' The SPLASH variable is now used as a timer for how long Henry will 
  345.       ' stay in the water. 
  346.       Inc SPLASH
  347.       '
  348.       Sprite Update 
  349.       Bob Draw 
  350.       '
  351.       Screen Swap 0
  352.       Wait Vbl 
  353.       Bob Clear 
  354.       '
  355.       If BONUS=1 Then FISH=I Bob(1) : If FISH=19 or FISH=29 Then Sam Bank 6 : Sam Play %1,1
  356.       Sprite Update 
  357.       Bob Draw 
  358.    Until Y Bob(26)>249 or SPLASH>40
  359.    '
  360.    ' Turn off the player bob,check to see if the player has lost all their
  361.    ' lives if so then call the GAMEOVER procedure.
  362.    If SPLASH>40 Then Bob Off 26
  363.    If LIVES=0 Then _GAMEOVER
  364.    '
  365.    ' Turn off Death animation,reset SPLASH,reset player starting position and 
  366.    ' image then swap screen and clear bobs to help stay in sync with mainloop.
  367.    Amal Off 5 : SPLASH=0 : X=315 : Y=182 : N=34 : I=2 : Sprite Update : Wait Vbl 
  368.    Screen Swap 0 : Wait Vbl : Bob Clear 
  369.    '
  370. End Proc
  371. '
  372. ' Makes Henry Jump up. 
  373. Procedure JUMP_UP
  374.    '
  375.    ' Change sample bank then play the Jumping sfx.
  376.    Sam Bank 5 : Sam Play %1100,5
  377.    '
  378.    ' First 'for next' loop makes Henry move up,tests for collisions and plays 
  379.    ' the soundfx. 
  380.    For N=1 To 34
  381.       Dec Y
  382.       If BONUS=1 Then _TIME : Rem Call TIME proc when your not in the Bonus stage. 
  383.       _EXTRA_LIFE
  384.       '
  385.       If Sprite Col(8,10 To 10) Then N=34 : _DEAD
  386.       If Spritebob Col(8,1 To 2) Then N=34 : _DEAD
  387.       If BONUS=0 and Spritebob Col(8,3 To 3) Then N=34 : _BDEAD
  388.       If Sprite Col(8,12 To 19) Then _GET_ITEM
  389.       If Y Sprite(8)<60 Then N=34 : Rem So Henry dos'nt go off screen. 
  390.       '
  391.       If BONUS=1 Then FISH=I Bob(1) : If FISH=19 or FISH=29 Then Sam Bank 6 : Sam Play %1,1
  392.       If BONUS=0 and CROW>40 Then Sam Bank 6 : Sam Play %11,3 : CROW=0
  393.       If GONG=0 Then Sam Bank 5 : Sam Play %1110,3 : GONG=70
  394.       Sprite 8,X,Y,I+D
  395.       Update 
  396.       Wait Vbl 
  397.    Next 
  398.    '
  399.    ' Secound loop makes Henry come down and checks for collisions with any
  400.    ' platforms and other Sprites & Bobs and plays the soundfx.
  401.    For N=1 To 34
  402.       If BONUS=1 Then _TIME
  403.       _EXTRA_LIFE
  404.       F=Point(X Screen(X Sprite(8)),Y Screen(Y Sprite(8)))
  405.       If F<>2 Then Inc Y
  406.       ' If Henry touches a platform before N=34 then N=34 and exits out of loop. 
  407.       If F=2 Then N=34
  408.       '
  409.       If Sprite Col(8,10 To 10) Then N=34 : _DEAD
  410.       If Spritebob Col(8,1 To 2) Then N=34 : _DEAD
  411.       If BONUS=0 and Spritebob Col(8,3 To 3) Then N=34 : _BDEAD
  412.       If Sprite Col(8,12 To 19) Then _GET_ITEM
  413.       '
  414.       If BONUS=1 Then FISH=I Bob(1) : If FISH=19 or FISH=29 Then Sam Bank 6 : Sam Play %1,1
  415.       If BONUS=0 and CROW>40 Then Sam Bank 6 : Sam Play %11,3 : CROW=0
  416.       If GONG=0 Then Sam Bank 5 : Sam Play %1110,3 : GONG=70
  417.       Sprite 8,X,Y,I+D
  418.       Update 
  419.       Wait Vbl 
  420.    Next 
  421.    '
  422.    ' Reset 'N' variable and clear the bobs to keep in sync with mainloop. 
  423.    N=1
  424.    Bob Clear 
  425.    '
  426. End Proc
  427. '
  428. ' Makes Henry Jump up and left.
  429. Procedure JUMP_LEFT
  430.    '
  431.    ' Change sample bank,play the Jumping sfx and call the EXTRA LIFE procedure. 
  432.    Sam Bank 5 : Sam Play %1100,5
  433.    _EXTRA_LIFE
  434.    '
  435.    ' First 'for next' loop makes Henry move up and left,tests for collisions
  436.    ' and plays the soundfx. 
  437.    For N=1 To 34
  438.       If BONUS=1 Then _TIME : Rem Call TIME proc when your not in the Bonus Stage. 
  439.       Add I,1,1 To 6 : Dec Y : If X>138 Then Dec X
  440.       '
  441.       If Sprite Col(8,10 To 10) Then N=34 : _DEAD
  442.       If Spritebob Col(8,1 To 2) Then N=34 : _DEAD
  443.       If BONUS=0 and Spritebob Col(8,3 To 3) Then N=34 : _BDEAD
  444.       If Sprite Col(8,24 To 24) Then _EXIT
  445.       If Y Sprite(8)<60 Then N=34 : Rem So Henry dos'nt go off screen. 
  446.       '
  447.       If BONUS=1 Then FISH=I Bob(1) : If FISH=19 or FISH=29 Then Sam Bank 6 : Sam Play %1,1
  448.       If BONUS=0 and CROW>40 Then Sam Bank 6 : Sam Play %11,3 : CROW=0
  449.       If GONG=0 Then Sam Bank 5 : Sam Play %1110,3 : GONG=70
  450.       Sprite 8,X,Y,I+D
  451.       Update 
  452.       Wait Vbl 
  453.    Next N
  454.    '
  455.    ' Secound loop makes Henry come down and move left checks for collisions 
  456.    ' with any platforms and other Sprites & Bobs and plays the soundfx. 
  457.    For N=1 To 34
  458.       If BONUS=1 Then _TIME
  459.       F=Point(X Screen(X Sprite(8)),Y Screen(Y Sprite(8)))
  460.       Add I,1,1 To 6 : If X>138 Then Dec X
  461.       If F<>2 Then Inc Y
  462.       ' If Henry touches a platform before N=34 then N=34 and exits out of loop. 
  463.       If F=2 Then N=34
  464.       '
  465.       If Sprite Col(8,10 To 10) Then N=34 : _DEAD
  466.       If Spritebob Col(8,1 To 2) Then N=34 : _DEAD
  467.       If BONUS=0 and Spritebob Col(8,3 To 3) Then N=34 : _BDEAD
  468.       If Sprite Col(8,24 To 24) Then _EXIT
  469.       '
  470.       If BONUS=1 Then FISH=I Bob(1) : If FISH=19 or FISH=29 Then Sam Bank 6 : Sam Play %1,1
  471.       If BONUS=0 and CROW>40 Then Sam Bank 6 : Sam Play %11,3 : CROW=0
  472.       If GONG=0 Then Sam Bank 5 : Sam Play %1110,3 : GONG=70
  473.       Sprite 8,X,Y,I+D
  474.       Update 
  475.       Wait Vbl 
  476.    Next N
  477.    '
  478.    ' Reset 'N' variable and clear the bobs to keep in sync with mainloop. 
  479.    N=1
  480.    Bob Clear 
  481.    '
  482. End Proc
  483. '
  484. ' Makes Henry Jump up and right. 
  485. Procedure JUMP_RIGHT
  486.    '
  487.    ' Change sample bank,play the Jumping sfx and calls the EXTRA LIFE procedure.
  488.    Sam Bank 5 : Sam Play %1100,5
  489.    _EXTRA_LIFE
  490.    '
  491.    ' First 'for next' loop makes Henry move up and right,tests for collisions 
  492.    ' and plays the soundfx. 
  493.    For N=1 To 34
  494.       If BONUS=1 Then _TIME : Rem Call TIME proc when your not in the Bonus Stage.   
  495.       Add I,1,1 To 6 : Dec Y : If X<438 Then Inc X
  496.       '
  497.       If Sprite Col(8,10 To 10) Then N=34 : _DEAD
  498.       If Spritebob Col(8,1 To 2) Then N=34 : _DEAD
  499.       If BONUS=0 and Spritebob Col(8,3 To 3) Then N=34 : _BDEAD
  500.       If Spritebob Col(8,5 To 5) Then N=34 : _BONUS
  501.       If Y Sprite(8)<60 Then N=34 : Rem So Henry dos'nt go off screen. 
  502.       '
  503.       If BONUS=1 Then FISH=I Bob(1) : If FISH=19 or FISH=29 Then Sam Bank 6 : Sam Play %1,1
  504.       If BONUS=0 and CROW>40 Then Sam Bank 6 : Sam Play %11,3 : CROW=0
  505.       If GONG=0 Then Sam Bank 5 : Sam Play %1110,3 : GONG=70
  506.       Sprite 8,X,Y,I+D
  507.       Update 
  508.       Wait Vbl 
  509.    Next 
  510.    '
  511.    ' Secound loop makes Henry come down and move right checks for collisions
  512.    ' with any platforms and other Sprites & Bobs and plays the soundfx. 
  513.    For N=1 To 34
  514.       If BONUS=1 Then _TIME
  515.       F=Point(X Screen(X Sprite(8)),Y Screen(Y Sprite(8)))
  516.       Add I,1,1 To 6 : If X<438 Then Inc X
  517.       If F<>2 Then Inc Y
  518.       ' If Henry touches a platform before N=34 then N=34 and exits out of loop. 
  519.       If F=2 Then N=34
  520.       '
  521.       If Sprite Col(8,10 To 10) Then N=34 : _DEAD
  522.       If Spritebob Col(8,1 To 2) Then N=34 : _DEAD
  523.       If BONUS=0 and Spritebob Col(8,3 To 3) Then N=34 : _BDEAD
  524.       If Spritebob Col(8,5 To 5) Then N=34 : _BONUS
  525.       '
  526.       If BONUS=1 Then FISH=I Bob(1) : If FISH=19 or FISH=29 Then Sam Bank 6 : Sam Play %1,1
  527.       If BONUS=0 and CROW>40 Then Sam Bank 6 : Sam Play %11,3 : CROW=0
  528.       If GONG=0 Then Sam Bank 5 : Sam Play %1110,3 : GONG=70
  529.       Sprite 8,X,Y,I+D
  530.       Update 
  531.       Wait Vbl 
  532.    Next 
  533.    '
  534.    ' Reset 'N' variable and clear the bobs to keep in sync with mainloop. 
  535.    N=1
  536.    Bob Clear 
  537.    '
  538. End Proc
  539. '
  540. ' Makes Henry start blinking.
  541. Procedure _BLINK
  542.    '
  543.    ' Set the Amal animation of Henry blinking and turn the automatic updating on. 
  544.    Channel 6 To Sprite 8
  545.    Sprite 8,X,Y,
  546.    F$="A 0,(88,30)(89,10)(88,10)(89,10);"
  547.    Amal 6,F$ : Amal On 6 : Update On 
  548.    '
  549.    ' Small loop which repeats itself until you move Henry.
  550.    Do 
  551.       ' Call TIME procedure,set joystic,check for collisions between the 
  552.       ' player and enemy and play the soundfx. 
  553.       _TIME
  554.       J=Joy(1)
  555.       If Spritebob Col(8,1 To 2) Then Update Off : _DEAD : Exit 
  556.       If Sprite Col(8,10 To 10) Then Update Off : _DEAD : Exit 
  557.       If BONUS=0 and Spritebob Col(8,3 To 3) Then Update Off : _BDEAD : Exit 
  558.       '
  559.       If BONUS=1 Then FISH=I Bob(1) : If FISH=19 or FISH=29 Then Sam Bank 6 : Sam Play %1,1
  560.       If GONG=0 Then Sam Bank 5 : Sam Play %1110,3 : GONG=70
  561.       If BONUS=0 : Inc CROW
  562.          If CROW>80 : Sam Bank 6 : Sam Play %11,3 : CROW=0 : End If 
  563.       End If 
  564.       '
  565.       ' Check for any joystic movement then exits out of loop. 
  566.       If J>0 Then Exit 
  567.       ' Wait for a vertical blank. 
  568.       Wait Vbl 
  569.    Loop 
  570.    '
  571.    ' Turns off blinking animation,automatic updateing and resets the BLINK timer. 
  572.    Amal Off 6 : Update Off : BLINK=0 : CROW=0
  573.    '
  574.    ' Depending on the BONUS value the program updates the bobs,swaps the screen 
  575.    ' and then clears the bobs on screen.This is so the program can stay in
  576.    ' sync when returning to mainloop. 
  577.    If BONUS=1
  578.       Bob Clear : Bob Draw : Screen Swap 0 : Wait Vbl : Bob Clear 
  579.    End If 
  580.    If BONUS=0
  581.       Bob Clear : Bob Draw : Screen Swap 1 : Wait Vbl : Bob Clear 
  582.    End If 
  583.    '
  584. End Proc
  585. '
  586. ' Reverses the player images to make Henry's left facing images. 
  587. Procedure _REVERSESPRITES
  588.    '
  589.    ' Goes through the image of player,gets the image,sets the hot spot then 
  590.    ' pastes the fliped image. 
  591.    For N=1 To 6
  592.       Bob 1,16,27,N : Wait Vbl : Get Bob N+6,9,1 To 25,28
  593.       Hot Spot N+6,$12 : Paste Bob 500,500,Hrev(N+6)
  594.    Next : Bob Off 1 : Wait Vbl 
  595.    '
  596. End Proc
  597. '
  598. ' Sets the Amal animations for the enemy.
  599. Procedure _AMAL
  600.    '
  601.    ' Set the Channels for each enemy and their starting positions.
  602.    Channel 1 To Sprite 10
  603.    Channel 2 To Bob 1
  604.    Channel 3 To Bob 2
  605.    Sprite 10,290,211,13
  606.    Bob 1,114,188,19
  607.    Bob 2,260,26,54
  608.    '
  609.    ' Set Amal animation strings for each enemy. 
  610.    A$="A 0,(13,5); M 0,0,40;"
  611.    A$=A$+"Snail:A 0,(13,180); M 120,0,180; A 1,(14,5)(15,5)(16,5)(17,5); M 0,0,20;"
  612.    A$=A$+"A 0,(18,180); M -120,0,180; A 1,(17,5)(16,5)(15,5)(14,5); M 0,0,20; Jump Snail;"
  613.    '
  614.    B$="A 0,(33,5); M 0,0,40;"
  615.    B$=B$+"Fish:A 1,(19,2)(20,6)(21,6); M 0,0,14; A 1,(22,50); M 0,-70,50 ; A 1,(23,6)(24,6)(25,6); M -5,-5,18; A 1,(26,6)(27,6); M -5,5,12;"
  616.    B$=B$+"A 1,(28,50); M 0,70,50; A 1,(29,1)(30,6)(31,6)(32,6); M 0,0,19; A 1,(33,20);M 10,0,20; Jump Fish;"
  617.    '
  618.    C$="A 1,(54,20); M 0,0,40;"
  619.    C$=C$+"Squirral:A 0,(54,10)(55,10); M 0,0,40; A 1,(56,8)(57,8)(58,8)(59,8); M 0,0,32; A 1,(59,5)(61,5)(62,5); M -3,0,15; A 0,(63,5)(64,5)(65,5)(66,5)(67,5); M -150,0,150"
  620.    C$=C$+"A 1,(62,5)(61,5)(59,5); M 0,0,15; A 0,(59,10)(60,10); M 0,0,40; A 1,(59,8)(58,8)(57,8)(56,8); M 0,0,32; A 1,(54,5)(68,5)(69,5); M 3,0,15; A 0,(70,5)(71,5)(72,5)(73,5)(74,5); M 150,0,150; A 1,(69,5)(68,5)(54,5); M 0,0,15; Jump Squirral;"
  621.    '
  622.    ' Set the Channels to the strings then turn on the Amal animations.
  623.    Amal 1,A$ : Amal 2,B$ : Amal 3,C$
  624.    Amal On 
  625.    '
  626. End Proc
  627. '
  628. ' Sets the positions for the first wave of items.
  629. Procedure _ITEMS
  630.    '
  631.    Sprite 12,147,74,75
  632.    Sprite 13,180,150,78
  633.    Sprite 14,184,101,79
  634.    Sprite 15,145,185,76
  635.    Sprite 16,340,82,77
  636.    Sprite 17,360,175,78
  637.    Sprite 18,430,130,75
  638.    '
  639. End Proc
  640. '
  641. ' Sets the positions for the secound wave of items.
  642. Procedure MORE_ITEMS
  643.    '
  644.    A=8 : Rem Sets number of items so the Mainloop only calls this procedure once.     
  645.    Sprite 12,148,126,77
  646.    Sprite 13,255,163,75
  647.    Sprite 14,239,86,76
  648.    Sprite 15,370,82,79
  649.    Sprite 16,145,185,78
  650.    Sprite 17,200,185,77
  651.    Sprite 18,425,133,76
  652.    '
  653. End Proc
  654. '
  655. ' Updates your score and turns off a sprite when you collect an item.
  656. Procedure _GET_ITEM
  657.    '
  658.    ' Turns off the sprite you have collided with,plays the Collect sfx and  
  659.    ' updates the EXSC variable. 
  660.    Sprite Off Col(-1) : Sam Bank 5 : Sam Play %1100,4 : A=A+1 : EXSC=EXSC+50
  661.    '
  662.    Screen 2
  663.    ' Updates your score variable. 
  664.    SC=SC+50
  665.    ' Turn score variable to string so it can be printed using 'Text'. 
  666.    C$=Str$(SC) : Text 144,20,C$
  667.    ' Return to the relevant game screen.
  668.    If BONUS=1 Then Screen 0
  669.    If BONUS=0 Then Screen 1
  670.    '
  671. End Proc
  672. '
  673. ' Restarts the game after finishing the Bonus stage. 
  674. Procedure _RESTART
  675.    '
  676.    ' Fades the bonus screen,turns off all sprites,bobs,Amal animations and hides screen.
  677.    Screen 1 : Fade 1 : Wait 15 : Sprite Off : Bob Off : Amal Off : Screen Hide 1
  678.    '
  679.    ' Resets the A,BONUS,X,Y and N variables and turns on the enemy animations.
  680.    Screen 0 : A=0 : BONUS=1 : X=310 : Y=182 : N=34 : Sprite Update : Wait Vbl : _AMAL
  681.    '
  682.    ' Place Exit back on screen and fade screen into view. 
  683.    Sprite 24,150,66,85
  684.    Screen Show 0
  685.    Fade 1,$34,$BBB,$340,$5A,$7C,$555,$A60,$951,$632,$422,$51,$61,$72,$92,$A3,$B4,$34,$0,$888,$FFF,$520,$840,$B70,$FB0,$486,$5A8,$5CA,$8E,$8,$A01,$D01,$EC8
  686.    Wait 15
  687.    '
  688. End Proc
  689. '
  690. ' Exits out of game once you have finished the level.
  691. Procedure _EXIT
  692.    '
  693.    ' Play Door sfx,make door open then turn off player sprite.
  694.    Sam Bank 5 : Sam Play %1100,1
  695.    Sprite 24,150,66,86
  696.    Sprite Off 8
  697.    Update 
  698.    Wait Vbl 
  699.    Wait 30
  700.    ' Fade screen,close it then reset player position. 
  701.    Screen 0 : Fade 2 : Wait 30 : Screen Close 0
  702.    X=310 : Y=182
  703.    '
  704.    ' Create 4 Main strings to hold the 4 main variables(LIVES,SC,EXSC,LEVEL). 
  705.    A$="   " : B$="      " : C$="     " : D$="  "
  706.    '
  707.    ' Convert the 4 variables into strings.
  708.    L$=Str$(LIVES) : S$=Str$(SC) : E$=Str$(EXSC) : LEV$=Str$(LEVEL)
  709.    '
  710.    ' Then place those strings into the above Main strings.
  711.    Right$(A$,3)=L$ : Left$(B$,6)=S$ : Right$(C$,5)=E$ : Right$(D$,2)=LEV$
  712.    '
  713.    ' Lastly place the final 4 strings into the Command Line$ to be passed 
  714.    ' through to the next program. 
  715.    Command Line$=A$+B$+C$+D$
  716.    '
  717.    ' Fade control panel,close it,turn off all Amal animations,erase memory
  718.    ' banks then load the Select Level program.
  719.    Screen 2 : Fade 2 : Wait 30 : Screen Close 2
  720.    Amal Off 
  721.    For B=0 To 15 : Erase B : Next B
  722.    Run "HenryGame/Selectlevel"
  723.    '
  724. End Proc
  725. '
  726. ' Updates your lives every 2000 points.
  727. Procedure _EXTRA_LIFE
  728.    '
  729.    If EXSC=2000
  730.       Screen 2
  731.       ' Play Extra life sfx. 
  732.       Sam Bank 5 : Sam Play %1110,6
  733.       '
  734.       ' Update LIVES variable by 1 and convert it to a string. 
  735.       LIVES=LIVES+1 : B$=Str$(LIVES)
  736.       ' Print the score string and depending on whether its a single or
  737.       ' double number offset the text position.
  738.       If LIVES>9 : Text 27,20,B$ : End If 
  739.       If LIVES<10 : Text 40,20,B$ : End If 
  740.       '
  741.       ' Reset EXSC variable to 0 and then return to the relevant screen. 
  742.       EXSC=0
  743.       If BONUS=1 : Screen 0 : End If 
  744.       If BONUS=0 : Screen 1 : End If 
  745.    End If 
  746.    '
  747. End Proc
  748. '
  749. ' Plays the Game Over animation then loads the Title program.
  750. Procedure _GAMEOVER
  751.    '
  752.    ' Close the relevant screens depending on whether you died in the main game
  753.    ' or the Bonus stage.
  754.    If BONUS=1
  755.       Screen 0 : Fade 2 : Wait 30 : Cls 0 : Sprite Off : Sprite Update : Wait Vbl : Bob Off : Amal Off : Screen Close 0
  756.       Screen 2 : Fade 2 : Wait 30 : Cls 0 : Screen Close 2
  757.    End If 
  758.    If BONUS=0
  759.       Screen 1 : Fade 2 : Wait 30 : Cls 0 : Sprite Off : Sprite Update : Wait Vbl : Bob Off : Amal Off : Screen Close 1
  760.       Screen 2 : Fade 2 : Wait 30 : Cls 0 : Screen Close 2
  761.    End If 
  762.    '
  763.    ' Open up new screen for animation,get the sprite palette,Double Buffer
  764.    ' screen for no flicker and turn update on.
  765.    Screen Open 0,320,200,32,Lowres : Screen Hide 0
  766.    Curs Off : Flash Off : Cls 0
  767.    Get Sprite Palette 
  768.    Double Buffer : Update On 
  769.    '
  770.    ' Set Amal animation.
  771.    Channel 15 To Bob 10
  772.    Bob 10,160,110,94
  773.    F$="A 0,(94,5)(95,5)(96,5)(97,5)(98,5)(99,5)"
  774.    Amal 15,F$ : Amal On 
  775.    '
  776.    ' Paste the 'Game Over' words on screen,fade screen to black then fade the 
  777.    ' screen into view.
  778.    Paste Bob 70,10,92 : Paste Bob 164,10,93
  779.    Fade 1 : Wait 15
  780.    Screen Show 0
  781.    Fade 1,$0,$BBB,$340,$5A,$7C,$555,$A60,$951,$632,$422,$51,$61,$72,$92,$A3,$B4,$34,$0,$888,$FFF,$520,$840,$B70,$FB0,$486,$5A8,$5CA,$8E,$8,$A01,$D01,$EC8
  782.    Wait 15
  783.    '
  784.    ' Small loop which exits when the GO variable equals 120 or you press Fire.
  785.    Do 
  786.       Bob 10,160,110,
  787.       If Fire(1)=-1 Then Exit 
  788.       Inc GO
  789.       If GO>120 Then Exit 
  790.       Wait Vbl 
  791.    Loop 
  792.    ' Small loop which exits once you have released the Fire button. 
  793.    Repeat 
  794.       Bob 10,160,110,
  795.       Wait Vbl 
  796.    Until Fire(1)=0
  797.    Fade 2 : Wait 30
  798.    '
  799.    ' Prepare a string to hold the score string. 
  800.    A$="      "
  801.    ' Convert the score to a string. 
  802.    S$=Str$(SC)
  803.    ' Place score string into 'A$' then place it in the command line$. 
  804.    Left$(A$,6)=S$
  805.    Command Line$=A$
  806.    '
  807.    ' Turn off Amal animations,close screen,erase memory banks then run the
  808.    ' Title program. 
  809.    Amal Off 
  810.    Screen Close 0
  811.    For B=0 To 15 : Erase B : Next B
  812.    Run "HenryGame/Title"
  813.    '
  814. End Proc
  815. '
  816. '----------------------------------------------------------------------------- 
  817. '              *******  Procedures for the Bonus Stage. *******  
  818. '
  819. ' Bonus stage mainloop which repeats until you have collected all of the items.
  820. Procedure _BONUS
  821.    '
  822.    ' Set the collect variable 'A',BONUS variable and jump variable so you do'nt 
  823.    ' continue jumping when you enter the bonus stage. 
  824.    A=16
  825.    BONUS=0 : N=34
  826.    ' Fade screen,turn off all sprites,bobs and animations then hide screen. 
  827.    Screen 0 : Fade 1 : Wait 15 : Sprite Off : Sprite Update : Bob Off : Amal Off : Screen Hide 0
  828.    '
  829.    ' Call the BSETUP procedure. 
  830.    _BSETUP
  831.    ' Alter the player starting coordinates. 
  832.    X=434 : Y=205
  833.    '
  834.    ' Loop handled in the same way as Mainloop(using screen swap).By using 
  835.    ' another mainloop for the Bonus stage the Game runs faster and smoother.
  836.    ' Loop ends when you have collected all of the items 
  837.    Repeat 
  838.       '
  839.       ' Swaps between the Phisical and Logical screens then clears the screen
  840.       ' of bobs. 
  841.       Screen Swap 1
  842.       Wait Vbl 
  843.       Bob Clear 
  844.       '
  845.       ' Sets the joystic,Call the EXTRA LIFE proc and check for collisions.
  846.       J=Joy(1)
  847.       _EXTRA_LIFE
  848.       If Spritebob Col(8,3 To 3) Then _BDEAD
  849.       If Sprite Col(8,12 To 23) Then _GET_ITEM
  850.       '
  851.       ' If Henry is left alone on a platform variable 'BLINK' increases or equals 0. 
  852.       If J=0 and F=2 Then Inc BLINK Else BLINK=0
  853.       If BLINK>20 Then _BLINK
  854.       '
  855.       ' Checks for joystic directions and if you have jumped.
  856.       If J=4 and X>138 Then Dec X : D=6 : Inc C : If C mod 4=0 Then Add I,1,1 To 6
  857.       If J=8 and X<438 Then Inc X : D=0 : Inc C : If C mod 4=0 Then Add I,1,1 To 6
  858.       If J=1 and F=2 Then JUMP_UP
  859.       If J=5 and F=2 Then D=6 : JUMP_LEFT
  860.       If J=9 and F=2 Then D=0 : JUMP_RIGHT
  861.       '
  862.       ' Checks to see if Henry has hit the bottom of the screen. 
  863.       If Y Sprite(8)>250 Then _BDEAD
  864.       ' Play Crow sfx every time the CROW variable equals 40 then reset it.  
  865.       Inc CROW : If CROW>40 Then Sam Bank 6 : Sam Play %11,3 : CROW=0
  866.       '
  867.       ' Checks for the collision between Henry and the platform colour.
  868.       F=Point(X Screen(X Sprite(8)),Y Screen(Y Sprite(8)))
  869.       If F<>2 Then Inc Y
  870.       ' Updates the player sprite and draws all the bobs on screen.
  871.       Sprite 8,X,Y,I+D
  872.       Sprite Update 
  873.       Bob Draw 
  874.       '
  875.       '----------------------------------------------------------------------- 
  876.       ' Swaps between the Phisical and Logical screens then clears the screen
  877.       ' of bobs. 
  878.       Screen Swap 1
  879.       Wait Vbl 
  880.       Bob Clear 
  881.       '
  882.       ' Sets the joystic and check for collisions. 
  883.       J=Joy(1)
  884.       If Spritebob Col(8,3 To 3) Then _BDEAD
  885.       If Sprite Col(8,12 To 23) Then _GET_ITEM
  886.       '
  887.       ' Checks for joystic and if you have hit the bottom. 
  888.       If J=4 and X>138 Then Dec X : D=6 : Inc C : If C mod 4=0 Then Add I,1,1 To 6
  889.       If J=8 and X<438 Then Inc X : D=0 : Inc C : If C mod 4=0 Then Add I,1,1 To 6
  890.       If Y Sprite(8)>250 Then _BDEAD
  891.       '
  892.       ' Checks for the platform colour collision and updates the player sprite.
  893.       F=Point(X Screen(X Sprite(8)),Y Screen(Y Sprite(8)))
  894.       If F<>2 Then Inc Y
  895.       Sprite 8,X,Y,I+D
  896.       Sprite Update 
  897.       Bob Draw 
  898.       '
  899.    Until A=27
  900.    '
  901.    ' Calls the RESTART procedure. 
  902.    _RESTART
  903.    '
  904. End Proc
  905. '
  906. ' Sets up the Bonus background,enemy animations and item positions.
  907. Procedure _BSETUP
  908.    '
  909.    ' Unpack the Bonus Background to screen 1 then hide it.
  910.    Unpack 11 To 1 : Screen Hide 1
  911.    Screen 1
  912.    ' Double Buffer screen for no flicker,turn Autoback to manual,turn Update
  913.    ' off then Update every 2 for smoother animation.
  914.    Double Buffer 
  915.    Autoback 0 : Update Off : Update Every 2
  916.    '
  917.    ' Set the Amal channel for the Bird and its animation. 
  918.    Channel 4 To Bob 3
  919.    Bob 3,-40,10,44
  920.    D$=" A 0,(44,10); M 0,0,10;"
  921.    D$=D$+"Bird:A 0,(44,5)(45,5)(46,5)(47,5)(48,5)(49,5)(50,5)(51,5)(52,5)(53,5); M 390,0,250; M 0,50,30;"
  922.    D$=D$+"A 0,(34,5)(35,5)(36,5)(37,5)(38,5)(39,5)(40,5)(41,5)(42,5)(43,5); M -390,0,250; M 0,50,40;"
  923.    D$=D$+"A 0,(44,5)(45,5)(46,5)(47,5)(48,5)(49,5)(50,5)(51,5)(52,5)(53,5); M 390,0,250; M 0,60,40;"
  924.    D$=D$+"A 0,(34,5)(35,5)(36,5)(37,5)(38,5)(39,5)(40,5)(41,5)(42,5)(43,5); M -390,0,250; M 0,-60,50;"
  925.    D$=D$+"A 0,(44,5)(45,5)(46,5)(47,5)(48,5)(49,5)(50,5)(51,5)(52,5)(53,5); M 390,0,250;M 0,-30,50;"
  926.    D$=D$+"A 0,(34,5)(35,5)(36,5)(37,5)(38,5)(39,5)(40,5)(41,5)(42,5)(43,5); M -390,0,250; M 0,-35,50;"
  927.    D$=D$+"A 0,(44,5)(45,5)(46,5)(47,5)(48,5)(49,5)(50,5)(51,5)(52,5)(53,5); M 390,0,250; M 0,-35,50;"
  928.    D$=D$+"A 0,(34,5)(35,5)(36,5)(37,5)(38,5)(39,5)(40,5)(41,5)(42,5)(43,5); M -390,0,250; Jump Bird"
  929.    Amal 4,D$ : Amal On 4
  930.    '
  931.    ' Set the positions for the items. 
  932.    Sprite 12,148,71,75
  933.    Sprite 13,210,166,78
  934.    Sprite 14,372,165,77
  935.    Sprite 16,145,197,77
  936.    Sprite 17,145,135,79
  937.    Sprite 18,210,231,75
  938.    Sprite 19,370,230,78
  939.    Sprite 20,435,134,84
  940.    Sprite 21,435,70,79
  941.    Sprite 22,210,103,77
  942.    Sprite 23,372,102,78
  943.    '    
  944.    ' Show Bonus screen. 
  945.    Screen Show 1
  946.    '
  947. End Proc
  948. '
  949. ' Updates the lives,sets the death animation then plays it on the Bonus screen.
  950. Procedure _BDEAD
  951.    '
  952.    ' This is a seperate DEAD procedure for the Bonus stage. 
  953.    ' Decrease the LIVES by 1 then convert variable to string to display lives.
  954.    Screen 2
  955.    LIVES=LIVES-1
  956.    B$=Str$(LIVES) : LD=Text Length(B$) : Text 64-LD,20,B$
  957.    '
  958.    Screen 1
  959.    ' Match the Bob starting position with the Player sprite position. 
  960.    DX=X Screen(X Sprite(8)) : DY=Y Screen(Y Sprite(8))
  961.    Bob 26,DX,DY,87
  962.    ' Set Amal animation.
  963.    Channel 5 To Bob 26
  964.    E$="A 0,(87,0); M 0,-20,20; M 0,-4,4; M 0,-3,3; M 0,-3,4; M 0,2,4; M 0,3,3; M 0,15,5; M 0,250,46"
  965.    Amal 5,E$ : Amal On 5
  966.    ' Turn off player sprite,play Ouch sfx and update bobs.
  967.    Sprite Off 8
  968.    Sam Bank 5 : Sam Play %1110,2
  969.    Bob Clear : Bob Draw 
  970.    '    
  971.    ' Small loop to allow Henry to finish death sequence without causing any 
  972.    ' problems to the Bonus mainloop eg,colliding while still playing the death anim.
  973.    Repeat 
  974.       Screen Swap 1
  975.       Wait Vbl 
  976.       Bob Clear 
  977.       Inc CROW : If CROW>40 Then Sam Bank 6 : Sam Play %11,3 : CROW=0
  978.       '
  979.       Sprite Update 
  980.       Bob Draw 
  981.       '
  982.       Screen Swap 1
  983.       Wait Vbl 
  984.       Bob Clear 
  985.       '
  986.       Sprite Update 
  987.       Bob Draw 
  988.    Until Y Bob(26)>249
  989.    '
  990.    ' If player has lost all their lives then call the GAMEOVER procedure. 
  991.    If LIVES=0 Then _GAMEOVER
  992.    '
  993.    ' Turn off Death animation,reset player starting position and image then 
  994.    ' swap screen and clear bobs to help stay in sync with Bonus mainloop. 
  995.    Amal Off 5 : X=434 : Y=205 : N=34 : I=2 : Sprite Update : Wait Vbl 
  996.    Screen Swap 1 : Wait Vbl : Bob Clear 
  997.    '
  998. End Proc
  999.