home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Merciful 3
/
Merciful_Release_3.bin
/
software
/
h
/
henrys_house
/
henryshouse1.dms
/
henryshouse1.adf
/
SourceCode
/
Level5.Asc
< prev
next >
Wrap
Text File
|
1993-06-20
|
43KB
|
1,187 lines
' Henry's House
'
' LEVEL FIVE SOURCE CODE
'
' by : Gurmita & Sucha Singh
'
'-----------------------------------------------------------------------------
' NOTE:This source code can not be Run through the AMOS editor as some files
' need to be copied into memory which is done in the startup-sequence of the
' full Game(see Intro source code).
'
' The following source code reseaves the Main variables LIVES,SC,EXSC and
' LEVEL.It then asks you to 'Press Fire' on the loading screen and then starts
' the Level.
'
' Memory Banks Used:
' 1 - Sprites - Sprites
' 5 - Sound - Main samples
' 6 - Sound - In Game Samples
' 9 - Pac Pic - Control Panel
' 10 - Pac Pic - Background Picture
' 11 - Pac Pic - Bonus Background
' 12 - Pac Pic - Insert Disc Picture
'
' Bobs and Sprites Used:
' Bob 1 - Bonus Entrance
' Bob 2 - Dracula
' Bob 3 - Spider
' Bob 4 - Ghost
' Bob 5 - Pumpkin
' Bob 6 - Bat
' Bob 7 - 2nd Bat
' Bob 10 - Henry Crying
' Bob 26 - Henry Hit
' Sprite 8 - Player
' Sprite 10 - Henry riding a broomstick
' Sprite 13 to 19 - Items
' Sprite 14 - Broomstick Shadow
' Sprite 20 - Rat
' Sprite 22 - Exit
'
' Variables Used:
' X - Player sprites X coordinates.
' Y - Player sprites Y coordinates.
' I - Player sprite Image.
' D - Start direction image for player.
' A - The number of items you have collected.
' F - The platform colour which you collide with.
' N - The current height of Henry when jumping.
' SC - Your current score.
' EXSC - Increases with your score but gets set to 0 if it equals 2000 when
' you get an extra life.
' LEVEL - The level number which effects the images of the doors.
' LIVES - Number of lives Henry has.
' BONUS - BONUS=1 when you're in the normal level or BONUS=0 when you enter
' the bonus stage.
' BLINK - Time taken for player to start blinking if left alone.
' TIME - The level time limit.
' COUNT - Used to slow down the time.
' GONG - Timer for the Gong sfx.
' SPD - Sets the speed of timer.
' GY - Ghost's Y coordinates.
'
'-----------------------------------------------------------------------------
'
' Increase sprite buffer.
Set Sprite Buffer 256
'
' Close the AMOS editor to save memory.
Close Editor
'
' Make the variables global so the whole program can access them.
Global X,Y,I,D,A,F,N,SC,EXSC,LEVEL,LIVES,BONUS,BLINK,TIME,COUNT,GONG,SPD,GY
'
' Set the variables.
X=430 : Y=222 : I=1 : D=0 : A=0 : BONUS=1 : BLINK=0 : TIME=80
COUNT=0 : GONG=80 : SPD=50 : GY=158
'
'-----------------------------------------------------------------------------
' Calls the SETUP procedure.
_SETUP
'
' Creates a mask for the sprites,sets Autoback to manual,turns off the
' automatic updating and updates every 2 vertical blank periods to make the
' Amal animations smoother.
Make Mask : Autoback 0 : Update Off : Update Every 2
'
'-----------------------------------------------------------------------------
' Calls the BLINK procedure.
_BLINK
'
' Calls the MAINLOOP procedure.
_MAINLOOP
'-----------------------------------------------------------------------------
'
' Uses Screen Swap which updates everything at once so making the Game run
' faster.Updates the timer,checks for collisions,the joystic,the platforms and
' the soundfx.
Procedure _MAINLOOP
'
' Manualy updates all the bobs so there is no flicker at the start.
Bob Clear : Bob Draw
'
' The loop is divided into two parts. The first is used to perform the
' various instructions in your program and the secound part repeats the
' above contents.This keeps the loop in sync.
Do
' Swaps between the Phisical and Logical screens then clears the screen
' of bobs.
Screen Swap 0
Wait Vbl
Bob Clear
'
' Calls the TIME and EXTRA LIFE procedures and sets the Joystic.
_TIME
_EXTRA_LIFE
J=Joy(1)
'
' Checks the collision between the player sprite and other bobs and sprites.
If Spritebob Col(8,2 To 4) Then _DEAD
If Sprite Col(8,20 To 20) Then _DEAD
If Sprite Col(8,13 To 19) Then _GET_ITEM
If Spritebob Col(8,1 To 1) Then _BONUS
If Sprite Col(8,22 To 22) Then _EXIT
'
' Stops the Ghost going out of the screen and makes its Y axis the same
' as Henry's.
If X Bob(4)<-14 Then GY=Y-64
If X Bob(4)>334 Then GY=Y-64
Bob 4,,GY,
'
' Places the next wave of items.
If A=7 Then MORE_ITEMS
'
' Places the Exit on screen when you have collected all the items.
If A=15 : Sprite 22,410,95,74 : A=16 : End If
'
' If all items are collected within the timelimit then the Bonus
' entrance opens.
If A=16 and TIME>0 : Bob 1,37,192,73 : Update : Wait Vbl : Bob Clear : TIME=0 : End If
'
' Checks for the joystic and floor,so if Henry is left alone on a
' platform the variable 'BLINK' increases or else it equals 0.
If J=0 and F=2 Then Inc BLINK Else BLINK=0
If BLINK>20 Then _BLINK
'
' Checks Left & Right joystic directions.If the joystic has been moved
' and Henry is away from the edge then he will either move left or right.
' The variable D sets the starting frame depending on the joystic direction
' you have moved.It then adds the frames to make Henry look like he's walking.
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
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
'
' Checks for Up,Up left and Up right directions.If the joystic has been
' moved in either of the up directions and Henry is on a platform then
' the relevant JUMP procedure is called.
If J=1 and F=2 Then JUMP_UP
If J=5 and F=2 Then D=6 : JUMP_LEFT
If J=9 and F=2 Then D=0 : JUMP_RIGHT
'
' Plays the Boo and Lightning sfx depending on the enemy's images.
If I Bob(4)=17 or I Bob(4)=26 Then Sam Bank 6 : Sam Play %11,1
If I Bob(2)=47 Then Sam Bank 6 : Sam Play %111,2
' Plays the Gong sfx when the Gong timer equals 0.
If GONG=0 Then Sam Bank 5 : Sam Play %1110,3 : GONG=80
'
' Checks for a collision between a colour on screen and the player sprite.
F=Point(X Screen(X Sprite(8)),Y Screen(Y Sprite(8)))
'
' If the colour is not equal to 2(the platform colour) then Henry will fall.
If F<>2 Then Inc Y
'
' Updates the player sprite and draws all the bobs on screen.
Sprite 8,X,Y,I+D
Sprite Update
Bob Draw
'
'-----------------------------------------------------------------------
' Swaps between the Phisical and Logical screens then clears the screen
' of bobs.
Screen Swap 0
Wait Vbl
Bob Clear
J=Joy(1)
'
' Stops the Ghost going out of the screen and makes its Y axis the same
' as Henry's.
If X Bob(4)<-14 Then GY=Y-64
If X Bob(4)>334 Then GY=Y-64
Bob 4,,GY,
'
If A=7 Then MORE_ITEMS
If A=15 : Bob 1,37,192,73 : Sprite 22,410,95,74 : Update : Wait Vbl : Bob Clear : A=16 : End If
'
' Checks for the joystic.By repeating it again it makes Henry walk faster.
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
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
'
' Checks for the collision between Henry and the platforms.
F=Point(X Screen(X Sprite(8)),Y Screen(Y Sprite(8)))
If F<>2 Then Inc Y
'
' Updates the player sprite and draws the bobs on screen.
Sprite 8,X,Y,I+D
Sprite Update
Bob Draw
Loop
'
End Proc
'
' Opens up a screen,sets the fonts,reseaves the variables from the last
' program then loads the bobs and sfx and waits until you have pressed fire
' on the loading screen to start the game.
Procedure _SETUP
'
' Hides mouse pointer,opens screen 0 and screen 2 then hides them both.
Hide On
Screen Open 0,320,200,32,Lowres : Screen Hide 0
Curs Off : Flash Off : Cls 0
Screen Open 2,320,30,16,Lowres : Screen Hide 2
Curs Off : Flash Off : Cls 0
'
' Loads fonts from Disk2 then checks all fonts to make sure they have loaded.
Get Disc Fonts
Screen 2
For F=0 To 6
Set Font F : T$="Amos 12345:"+Str$(F)
Text 0,0,T$
Next F
Cls 0
'
' Unpacks the Control Panel to screen 2 hides it,fades it to black then
' sets its display.
Unpack 9 To 2 : Screen Hide 2 : Fade 1 : Wait 15
Screen Display 2,130,252,320,30
'
' Reseaves the command line$ then separates its contents into the 4 strings.
Set Font 6
B$=Left$(Command Line$,3)
C$=Mid$(Command Line$,4,6)
D$=Mid$(Command Line$,10,5)
E$=Right$(Command Line$,1)
'
' Converts the 4 strings into variables.
LIVES=Val(B$) : SC=Val(C$) : EXSC=Val(D$) : LEVEL=Val(E$)
'
' Prints the Lives,Score and Time onto the control panel.
If LIVES<10 Then Ink 2,0 : Text 39,20,B$ : Text 144,20,C$
If LIVES>9 Then Ink 2,0 : Text 27,20,B$ : Text 144,20,C$
Ink 2,0 : Text 278,20,"80"
'
' Loads the powerpacked bobs and sfx.
Screen 0
'Ppload "Henry's_HouseD2:bobs/SpritesLev5"
'Ppload "Henry's_HouseD2:sound/MainSfx",5
'
' Display message 'Press Fire To Start'.
Screen 1 : Paste Bob 115,180,110
'
' Small loop which keeps you at the loading screen until you press Fire.
Do
J=Joy(1)
If Fire(1)=-1 Then Exit
Paste Bob 115,180,110 : Bob Update
Wait Vbl
Loop
' Small loop which repeats until you have released the fire button then
' fades the screen and closes it.
Repeat
Until Fire(1)=0
Screen 1 : Fade 1 : Wait 15 : Screen Close 1
'
' Unpacks the background to screen 0,hides it then Double Buffers the
' screen for no flicker.
Screen 0 : Unpack 10 To 0 : Screen Hide 0
Double Buffer
'
' Sets the hot spot to bottom centre for the Player images and calls the
' AMAL and ITEMS procedures.
For N=1 To 12 : Hot Spot N,$12 : Next
_AMAL
_ITEMS
'
' Fades background to black then fades the Control Panel and Background
' picture into view.
Fade 1 : Wait 15
Screen 2
Screen Show 2
Fade 1,$0,$BBB,$FFF,$EB0,$E90,$FD0,$B70,$840,$520,$CF,$6E,$F7E,$F0,$A01,$D01,$EC8
Wait 15
Screen 0
Screen Show 0
Fade 1,$0,$BBB,$67,$333,$444,$555,$775,$887,$DC2,$9B9,$898,$686,$565,$225,$347,$57A,$34,$0,$888,$FFF,$520,$840,$B70,$FB0,$486,$5A8,$5CA,$8E,$8,$A01,$D01,$EC8
Wait 15
'
' Sets the volume for all channels to maximum.
Volume %1111,63
'
End Proc
'
' Updates the Time.
Procedure _TIME
'
' As long as the time is greater than 0 then the variable,to slow down the
' timer,can keep on increasing.
If TIME>0 Then Inc COUNT
'
' Adds 1 to the TIME variable and decreases the GONG variable whenever COUNT=50.
If COUNT>SPD
TIME=TIME-1 : Dec GONG : COUNT=0
' Convert TIME variable to a string so it can be printed using 'Text'.
A$=Str$(TIME)
Screen 2 : L=Text Length(A$) : Text 304-L,20,A$
End If
'
' Returns program back to relevant screen.
If BONUS=1 : Screen 0 : End If
If BONUS=0 : Screen 1 : End If
'
End Proc
'
' Updates the lives,sets the death animation then plays it until its finished.
Procedure _DEAD
'
' Decrease the LIVES by 1,convert variable into a string to display your lives.
Screen 2
LIVES=LIVES-1
B$=Str$(LIVES) : LD=Text Length(B$) : Text 64-LD,20,B$
'
Screen 0
' Match the Bob starting position with the Player sprite position.
DX=X Screen(X Sprite(8)) : DY=Y Screen(Y Sprite(8))
Bob 26,DX,DY,106
' Set Amal animation.
Channel 8 To Bob 26
I$="A 0,(106,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,260,46"
Amal 8,I$ : Amal On 8
' Turn off player sprite,play Ouch sfx and update bobs.
Sprite Off 8
Sam Bank 5 : Sam Play %1110,2
Bob Clear : Bob Draw
'
' Small loop to allow Henry to finish death sequence without causing any
' problems to the main loop eg,colliding while still playing the death anim.
Repeat
Screen Swap 0
Wait Vbl
Bob Clear
_TIME
If I Bob(4)=17 or I Bob(4)=26 Then Sam Bank 6 : Sam Play %11,1
If I Bob(2)=47 Then Sam Bank 6 : Sam Play %111,2
If GONG=0 Then Sam Bank 5 : Sam Play %1110,3 : GONG=80
'
Sprite Update
Bob Draw
'
Screen Swap 0
Wait Vbl
Bob Clear
'
Sprite Update
Bob Draw
Until Y Bob(26)>259
'
' Check to see if the player has lost all their lives if so then call the
' GAMEOVER procedure.
If LIVES=0 Then _GAMEOVER
'
' Turn off Death animation,reset player starting position,'N' variable and
' image then swap screen and clear bobs to help stay in sync with mainloop.
Amal Off 8 : X=430 : Y=220 : N=34 : I=2 : Sprite Update : Wait Vbl
Screen Swap 0 : Wait Vbl : Bob Clear
'
End Proc
'
' Makes Henry Jump up.
Procedure JUMP_UP
'
' Change sample bank then play the Jumping sfx.
Sam Bank 5 : Sam Play %1100,5
'
' First 'for next' loop makes Henry move up,tests for collisions and plays
' the soundfx.
For N=1 To 34
Dec Y
_TIME
_EXTRA_LIFE
If Spritebob Col(8,2 To 4) Then N=34 : _DEAD
If Sprite Col(8,20 To 20) Then N=34 : _DEAD
If Sprite Col(8,13 To 19) Then _GET_ITEM
If Y Sprite(8)<60 Then N=34 : Rem So Henry dos'nt go off screen.
'
If I Bob(4)=17 or I Bob(4)=26 Then Sam Bank 6 : Sam Play %11,1
If I Bob(2)=47 Then Sam Bank 6 : Sam Play %111,2
If GONG=0 Then Sam Bank 5 : Sam Play %1110,3 : GONG=80
'
' Match position of Ghost with player.
If X Bob(4)<-14 Then GY=Y-64
If X Bob(4)>334 Then GY=Y-64
Bob 4,,GY,
Sprite 8,X,Y,I+D
Update
Wait Vbl
Next
'
' Secound loop makes Henry come down and checks for collisions with any
' platforms and other Sprites & Bobs and plays the soundfx.
For N=1 To 34
_TIME
_EXTRA_LIFE
F=Point(X Screen(X Sprite(8)),Y Screen(Y Sprite(8)))
If F<>2 Then Inc Y
' If Henry touches a platform before N=34 then N=34 and exits out of loop.
If F=2 Then N=34
'
If Spritebob Col(8,2 To 4) Then N=34 : _DEAD
If Sprite Col(8,20 To 20) Then N=34 : _DEAD
If Sprite Col(8,13 To 19) Then _GET_ITEM
'
If I Bob(4)=17 or I Bob(4)=26 Then Sam Bank 6 : Sam Play %11,1
If I Bob(2)=47 Then Sam Bank 6 : Sam Play %111,2
If GONG=0 Then Sam Bank 5 : Sam Play %1110,3 : GONG=80
'
' Match position of Ghost with player.
If X Bob(4)<-14 Then GY=Y-64
If X Bob(4)>334 Then GY=Y-64
Bob 4,,GY,
Sprite 8,X,Y,I+D
Update
Wait Vbl
Next
'
' Reset 'N' variable and clear the bobs to keep in sync with mainloop.
N=1
Bob Clear
'
End Proc
'
' Makes Henry Jump up and left.
Procedure JUMP_LEFT
'
' Change sample bank,play the Jumping sfx and call the EXTRA LIFE procedure.
Sam Bank 5 : Sam Play %1100,5
_EXTRA_LIFE
'
' First 'for next' loop makes Henry move up and left,tests for collisions
' and plays the soundfx.
For N=1 To 34
_TIME
Add I,1,1 To 6 : Dec Y : If X>140 Then Dec X
If Spritebob Col(8,2 To 4) Then N=34 : _DEAD
If Sprite Col(8,20 To 20) Then N=34 : _DEAD
If Y Sprite(8)<60 Then N=34 : Rem So Henry dos'nt go off screen.
'
If I Bob(4)=17 or I Bob(4)=26 Then Sam Bank 6 : Sam Play %11,1
If I Bob(2)=47 Then Sam Bank 6 : Sam Play %111,2
If GONG=0 Then Sam Bank 5 : Sam Play %1110,3 : GONG=80
'
' Match position of Ghost with player.
If X Bob(4)<-14 Then GY=Y-64
If X Bob(4)>334 Then GY=Y-64
Bob 4,,GY,
Sprite 8,X,Y,I+D
Update
Wait Vbl
Next N
'
' Secound loop makes Henry come down and move left checks for collisions
' with any platforms and other Sprites & Bobs and plays the soundfx.
For N=1 To 34
_TIME
F=Point(X Screen(X Sprite(8)),Y Screen(Y Sprite(8)))
Add I,1,1 To 6 : If X>140 Then Dec X
If F<>2 Then Inc Y
' If Henry touches a platform before N=34 then N=34 and exits out of loop.
If F=2 Then N=34
'
If Spritebob Col(8,2 To 4) Then N=34 : _DEAD
If Sprite Col(8,20 To 20) Then N=34 : _DEAD
'
If I Bob(4)=17 or I Bob(4)=26 Then Sam Bank 6 : Sam Play %11,1
If I Bob(2)=47 Then Sam Bank 6 : Sam Play %111,2
If GONG=0 Then Sam Bank 5 : Sam Play %1110,3 : GONG=80
'
' Match position of Ghost with player.
If X Bob(4)<-14 Then GY=Y-64
If X Bob(4)>334 Then GY=Y-64
Bob 4,,GY,
Sprite 8,X,Y,I+D
Update
Wait Vbl
Next N
'
' Reset 'N' variable and clear the bobs to keep in sync with mainloop.
N=1
Bob Clear
'
End Proc
'
' Makes Henry Jump up and right.
Procedure JUMP_RIGHT
'
' Change sample bank,play the Jumping sfx and calls the EXTRA LIFE procedure.
Sam Bank 5 : Sam Play %1100,5
_EXTRA_LIFE
'
' First 'for next' loop makes Henry move up and right,tests for collisions
' and plays the soundfx.
For N=1 To 34
_TIME
Add I,1,1 To 6 : Dec Y : If X<436 Then Inc X
If Spritebob Col(8,2 To 4) Then N=34 : _DEAD
If Sprite Col(8,20 To 20) Then N=34 : _DEAD
If Y Sprite(8)<60 Then N=34 : Rem So Henry dos'nt go off screen.
'
If I Bob(4)=17 or I Bob(4)=26 Then Sam Bank 6 : Sam Play %11,1
If I Bob(2)=47 Then Sam Bank 6 : Sam Play %111,2
If GONG=0 Then Sam Bank 5 : Sam Play %1110,3 : GONG=80
'
' Match position of Ghost with player.
If X Bob(4)<-14 Then GY=Y-64
If X Bob(4)>334 Then GY=Y-64
Bob 4,,GY,
Sprite 8,X,Y,I+D
Update
Wait Vbl
Next
'
' Secound loop makes Henry come down and move right checks for collisions
' with any platforms and other Sprites & Bobs and plays the soundfx.
For N=1 To 34
_TIME
F=Point(X Screen(X Sprite(8)),Y Screen(Y Sprite(8)))
Add I,1,1 To 6 : If X<436 Then Inc X
If F<>2 Then Inc Y
' If Henry touches a platform before N=34 then N=34 and exits out of loop.
If F=2 Then N=34
'
If Spritebob Col(8,2 To 4) Then N=34 : _DEAD
If Sprite Col(8,20 To 20) Then N=34 : _DEAD
'
If I Bob(4)=17 or I Bob(4)=26 Then Sam Bank 6 : Sam Play %11,1
If I Bob(2)=47 Then Sam Bank 6 : Sam Play %111,2
If GONG=0 Then Sam Bank 5 : Sam Play %1110,3 : GONG=80
'
' Match position of Ghost with player.
If X Bob(4)<-14 Then GY=Y-64
If X Bob(4)>334 Then GY=Y-64
Bob 4,,GY,
Sprite 8,X,Y,I+D
Update
Wait Vbl
Next
'
' Reset 'N' variable and clear the bobs to keep in sync with mainloop.
N=1
Bob Clear
'
End Proc
'
' Makes Henry start blinking.
Procedure _BLINK
'
' Set the Amal animation of Henry blinking and turn the automatic updating on.
Channel 9 To Sprite 8
Sprite 8,X,Y,
J$="A 0,(108,30)(109,10)(108,10)(109,10);"
Amal 9,J$ : Amal On 9 : Update On
'
' Small loop which repeats itself until you move Henry.
Do
' Call TIME procedure,set joystic,check for collisions between the
' player and enemy,match position of Ghost with Player and play the sfx.
_TIME
J=Joy(1)
If Spritebob Col(8,2 To 4) Then Update Off : _DEAD : Exit
If Sprite Col(8,20 To 20) Then Update Off : _DEAD : Exit
'
If X Bob(4)<-14 Then GY=Y Sprite(8)-64
If X Bob(4)>334 Then GY=Y Sprite(8)-64
Bob 4,,GY,
'
If I Bob(4)=17 or I Bob(4)=26 Then Sam Bank 6 : Sam Play %11,1
If I Bob(2)=47 Then Sam Bank 6 : Sam Play %111,2
If GONG=0 Then Sam Bank 5 : Sam Play %1110,3 : GONG=80
'
' Check for any joystic movement then exits out of loop.
If J>0 Then Exit
' Wait for a vertical blank.
Wait Vbl
Loop
'
' Turns off blinking animation,automatic updateing and reset the BLINK timer.
Amal Off 9 : Update Off : BLINK=0
'
' Update bobs,Swaps the screen then clears the bobs on screen.This is so
' the program can stay in sync when returning to the Mainloop.
Bob Clear : Bob Draw : Screen Swap 0 : Wait Vbl : Bob Clear
'
End Proc
'
' Reverses the player images to make Henry's left facing images.
Procedure _REVERSESPRITES
'
' Goes through the image of player,gets the image,sets the hot spot then
' pastes the fliped image.
For N=1 To 6
Bob 1,16,27,N : Wait Vbl : Get Bob N+6,9,1 To 25,28
Hot Spot N+6,$12 : Paste Bob 500,500,Hrev(N+6)
Next : Bob Off 1 : Wait Vbl
'
End Proc
'
' Sets the Amal animations for the enemy.
Procedure _AMAL
'
' Set the Channels for each enemy and their starting positions.
Channel 1 To Bob 2
Channel 2 To Bob 3
Channel 3 To Sprite 20
Channel 4 To Bob 4
Bob 2,160,-20,31
Bob 3,38,-30,56
Bob 4,-30,,13
Sprite 20,120,243,63
'
' Set Amal animation strings for each enemy.
A$="A 0,(67,5)M 0,0,20; A 0,(31,5)(32,5)(33,5)(32,5); M 110,42,150"
A$=A$+"Dracula: A 1,(37,20)(38,5)(39,5)(40,5)(41,5)(42,5)(43,5)(44,5)(45,5)(46,10)(47,2)(46,10);M 0,0,82"
A$=A$+"A 1,(48,5)(49,5);M 0,0,10;A 0,(50,10)(49,10)(51,10)(49,10);M 40,0,90;"
A$=A$+"A 1,(48,5)(46,5)(52,5)(53,5); M 0,0,20; A 0,(54,10)(53,10)(55,10)(53,10); M -80,0,160"
A$=A$+"A 1,(52,5)(46,10)(45,5)(44,5)(43,5)(42,5)(41,5)(40,5)(39,5)(37,10); M 0,0,60"
'
A$=A$+"A 0,(34,5)(35,5)(36,5)(35,5); M -178,45,150;"
A$=A$+"A 1,(37,20)(38,5)(39,5)(40,5)(41,5)(42,5)(43,5)(44,5)(45,5)(46,10)(47,2)(46,10);M 0,0,82"
A$=A$+"A 1,(52,5)(53,5);M 0,0,10;A 0,(54,10)(53,10)(55,10)(53,10);M -40,0,90;"
A$=A$+"A 1,(52,5)(46,5)(48,5)(49,5); M 0,0,20; A 0,(50,10)(49,10)(51,10)(49,10); M 80,0,160"
A$=A$+"A 1,(48,5)(46,10)(45,5)(44,5)(43,5)(42,5)(41,5)(40,5)(39,5)(37,10); M 0,0,60"
'
A$=A$+"A 0,(31,5)(32,5)(33,5)(32,5); M 133,46,150;"
A$=A$+"A 1,(37,20)(38,5)(39,5)(40,5)(41,5)(42,5)(43,5)(44,5)(45,5)(46,10)(47,2)(46,10);M 0,0,82"
A$=A$+"A 1,(48,5)(49,5);M 0,0,10;A 0,(50,10)(49,10)(51,10)(49,10);M 40,0,90;"
A$=A$+"A 1,(48,5)(46,5)(52,5)(53,5); M 0,0,20; A 0,(54,10)(53,10)(55,10)(53,10); M -80,0,160"
A$=A$+"A 1,(52,5)(46,10)(45,5)(44,5)(43,5)(42,5)(41,5)(40,5)(39,5)(37,10); M 0,0,60"
'
A$=A$+"A 0,(34,5)(35,5)(36,5)(35,5); M -131,-46,150;"
A$=A$+"A 1,(37,20)(38,5)(39,5)(40,5)(41,5)(42,5)(43,5)(44,5)(45,5)(46,10)(47,2)(46,10);M 0,0,82"
A$=A$+"A 1,(52,5)(53,5);M 0,0,10;A 0,(54,10)(53,10)(55,10)(53,10);M -40,0,90;"
A$=A$+"A 1,(52,5)(46,5)(48,5)(49,5); M 0,0,20; A 0,(50,10)(49,10)(51,10)(49,10); M 80,0,160"
A$=A$+"A 1,(48,5)(46,10)(45,5)(44,5)(43,5)(42,5)(41,5)(40,5)(39,5)(37,10); M 0,0,60"
A$=A$+"A 0,(31,5)(32,5)(33,5)(32,5); M 177,-45,150;Jump Dracula"
'
B$="A 0,(56,5)(57,5)(58,5)(57,5);"
B$=B$+"Spider: M 0,47,120; M 0,0,20; M 0,-47,120; M 168,0,2;"
B$=B$+"M 0,42,120; M 0,0,20; M 0,-42,120; M -89,0,2;"
B$=B$+"M 0,42,120; M 0,0,20; M 0,-42,120; M -79,0,2;Jump Spider"
'
C$="Rat:A 0,(63,5)(64,5)(65,5)(66,5); M 340,0,260; M 0,0,40;"
C$=C$+"A 0,(59,5)(60,5)(61,5)(62,5); M -340,0,260; M 0,0,40;Jump Rat"
'
D$="Ghost: M 0,0,40; A 0,(13,5)(14,5)(15,5)(16,5); M 127,0,100;"
D$=D$+"A 0,(17,5); M 1,0,1; A 0,(18,5)(19,5)(20,5)(21,5); M 126,0,100;"
D$=D$+"A 0,(13,5)(14,5)(15,5)(16,5); M 127,0,100;"
D$=D$+"M 0,0,40; A 0,(22,5)(23,5)(24,5)(25,5); M -127,0,100;"
D$=D$+"A 0,(26,5); M -1,0,1; A 0,(27,5)(28,5)(29,5)(30,5); M -126,0,100;"
D$=D$+"A 0,(22,5)(23,5)(24,5)(25,5); M -127,0,100;Jump Ghost"
'
' Set the Channels to the strings then turn on the Amal animations.
Amal 1,A$ : Amal 2,B$ : Amal 3,C$ : Amal 4,D$
Amal On
'
End Proc
'
' Sets the positions for the first wave of items.
Procedure _ITEMS
'
Sprite 13,240,238,68
Sprite 14,148,194,70
Sprite 15,158,86,69
Sprite 16,334,70,71
Sprite 17,422,150,72
Sprite 18,260,116,68
Sprite 19,350,182,69
'
End Proc
'
' Sets the positions for the secound wave of items.
Procedure MORE_ITEMS
'
A=8 : Rem Sets number of items so the Mainloop only calls this procedure once.
Sprite 13,230,194,72
Sprite 14,172,140,68
Sprite 15,340,238,69
Sprite 16,334,70,72
Sprite 17,240,70,70
Sprite 18,350,164,71
Sprite 19,262,112,69
'
End Proc
'
' Updates your score and turns off a sprite when you collect an item.
Procedure _GET_ITEM
'
' Turns off the sprite you have collided with,plays the Collect sfx and
' updates the EXSC variable.
Sprite Off Col(-1) : Sam Bank 5 : Sam Play %1100,4 : A=A+1 : EXSC=EXSC+50
'
Screen 2
' Updates your score variable.
SC=SC+50
' Turn score variable to string so it can be printed using 'Text'.
C$=Str$(SC) : Text 144,20,C$
' Return to screen 0.
Screen 0
'
End Proc
'
' Restarts the game after finishing the Bonus stage.
Procedure _RESTART
'
' Fades bonus screen,turns off all sprites,bobs,Amal animations and hides screen.
Screen 1 : Fade 1 : Wait 15 : Shift Off : Sprite Off : Bob Off : Amal Off : Screen Close 1
'
' Unpack the level background back to screen 0,hide it then fade it to
' black.Next Double Buffer it for no flicker,set Autoback to manual and
' turn the automatic updateing off and Update every 2 for smoother animation.
Unpack 10 To 0 : Screen Hide 0 : Fade 1 : Wait 15
Double Buffer : Autoback 0 : Update Off : Update Every 2
'
' Resets the A,BONUS,TIME,SPD and X and Y variables and turn on enemy animations.
Screen 0 : A=0 : BONUS=1 : TIME=0 : SPD=50 : X=430 : Y=220 : Sprite Update : _AMAL
' Reset the time on the Panel.
Screen 2 : Ink 2,0 : Text 288,20,"00"
Screen 0 : Screen Show 0
'
' Place Exit back on screen and fade screen into view.
Sprite 22,410,95,74
Fade 1,$0,$BBB,$67,$333,$444,$555,$775,$887,$DC2,$9B9,$898,$686,$565,$225,$347,$57A,$34,$0,$888,$FFF,$520,$840,$B70,$FB0,$486,$5A8,$5CA,$8E,$8,$A01,$D01,$EC8
Wait 15
'
End Proc
'
' Exits out of game once you have finished the level.
Procedure _EXIT
'
' Play Door sfx,make door open then turn off player sprite.
Sam Bank 5 : Sam Play %1110,1
Sprite 22,410,95,75
Sprite Off 8
Sprite Update
Wait Vbl
Wait 30
' Fade screen,close it then reset player position.
Screen 0 : Fade 2 : Wait 30 : Screen Close 0
X=430 : Y=220
'
' Prepare a string to hold the score string.
A$=" "
' Convert the score to a string.
S$=Str$(SC)
' Place score string into 'A$' then place it in the command line$.
Left$(A$,6)=S$
Command Line$=A$
' Turn off Amal animations and close screen.
Amal Off
Screen 2 : Fade 2 : Wait 30 : Screen Close 2
'
'--------------------------------------------------------------------------
'
' Unpacks bank 12 to screen 1 then hides screen 1 while fadeing picture to
' black.
Unpack 12 To 0 : Screen 0 : Screen Hide 0 : Fade 1 : Wait 15
'
' Checks for an error and goes to HELP: if one is detected.
On Error Goto HELP
'
' Creates an error. This stops the system message popping up.
Error 86
'
' Sets directory to Disk1,fades the screen then closes it.
Dir$="Henry's_House:"
Screen 0 : Fade 1 : Wait 15
' Erases all banks to clear the memory for next program then runs the
' Endseq program.
For B=0 To 15 : Erase B : Next B
Run "Endseq"
'
HELP:
'
' Small Loop to check if Disk 1 has been inserted.The vaiable 'D' is used
' to store a true(-1) or false(0) value.
Do
' If Disk1 has been inserted then the dirctory is set to Disk1, D=1 and
' exits out of loop.
If Exist("Henry's_House:")=-1 Then Dir$="Henry's_House:" : D=1 : Exit
'
' If Disk1 has not been inserted it fades screen 1 into view which asks
' you to 'insert Disc1', D=0 and exits out of loop.
If Exist("Henry's_House:")=0
Screen Show 0
Fade 1,$0,$8BD,$BDE,$FFF,$6AB,$59A,$379,$268,$156,$46,$E52,$E82,$FA3,$FC4,$FE5,$0
Wait 15
D=0 : Exit
End If
Loop
'
' If D=1 then the program jumps to the line after Error86 and continues,if
' D<>1 ie=0 then the program jumps to Error86 then back to the loop.
If D=1 Then Resume Next Else Resume
'
End Proc
'
' Updates your lives every 2000 points.
Procedure _EXTRA_LIFE
'
If EXSC=2000
Screen 2
' Play Extra life sfx.
Sam Bank 5 : Sam Play %1110,6
'
' Update LIVES variable by 1 and convert it to a string.
LIVES=LIVES+1 : B$=Str$(LIVES)
' Print the score string and depending on whether its a single or
' double number offset the text position.
If LIVES>9 : Text 27,20,B$ : End If
If LIVES<10 : Text 40,20,B$ : End If
'
' Reset EXSC variable to 0 and then return to the relevant screen.
EXSC=0
If BONUS=1 : Screen 0 : End If
If BONUS=0 : Screen 1 : End If
End If
'
End Proc
'
' Plays the Game Over animation then loads the Title program.
Procedure _GAMEOVER
'
' Close the relevant screens depending on whether you died in the main game
' or the Bonus stage.
If BONUS=1
Screen 0 : Fade 2 : Wait 30 : Cls 0 : Sprite Off : Sprite Update : Wait Vbl : Bob Off : Amal Off : Screen Close 0
Screen 2 : Fade 2 : Wait 30 : Cls 0 : Screen Close 2
End If
If BONUS=0
Screen 1 : Fade 2 : Wait 30 : Shift Off : Cls 0 : Sprite Off : Sprite Update : Wait Vbl : Bob Off : Amal Off : Screen Close 1
Screen 2 : Fade 2 : Wait 30 : Cls 0 : Screen Close 2
End If
'
' Open up new screen for animation,get the sprite palette,Double Buffer
' screen for no flicker and turn update on.
Screen Open 0,320,200,32,Lowres : Screen Hide 0
Curs Off : Flash Off : Cls 0
Get Sprite Palette
Double Buffer : Update On
'
' Set Amal animation.
Channel 15 To Bob 10
Bob 10,160,110,113
F$="A 0,(113,5)(114,5)(115,5)(116,5)(117,5)(118,5)"
Amal 15,F$ : Amal On
'
' Paste the 'Game Over' words on screen,fade screen to black then fade the
' screen into view.
Paste Bob 70,10,111 : Paste Bob 164,10,112
Fade 1 : Wait 15
Screen Show 0
Fade 1,$0,$BBB,$67,$333,$444,$555,$775,$887,$DC2,$9B9,$898,$686,$565,$225,$347,$57A,$34,$0,$888,$FFF,$520,$840,$B70,$FB0,$486,$5A8,$5CA,$8E,$8,$A01,$D01,$EC8
Wait 15
'
' Small loop which exits when the GO variable equals 120 or you press Fire.
Do
Bob 10,160,110,
If Fire(1)=-1 Then Exit
Inc GO
If GO>120 Then Exit
Wait Vbl
Loop
' Small loop which exits once you have released the Fire button.
Repeat
Bob 10,160,110,
Wait Vbl
Until Fire(1)=0
Fade 2 : Wait 30
'
' Prepare a string to hold the score string.
A$=" "
' Convert the score to a string.
S$=Str$(SC)
' Place score string into 'A$' then place it in the command line$.
Left$(A$,6)=S$
Command Line$=A$
'
' Turn off Amal animations,close screen,erase memory banks then run the
' Title program.
Amal Off
Screen Close 0
For B=0 To 15 : Erase B : Next B
Run "HenryGame/Title"
'
End Proc
'
'-----------------------------------------------------------------------------
' ******* Procedures for the Bonus Stage. *******
'
' Bonus stage mainloop which moves the Broomstic,animates the Bats and the
' Pumpkin and tests for collisions.
Procedure _BONUS
'
' Set the collect variable 'A',BONUS,TIME and SPD variables.
A=16
BONUS=0 : TIME=60 : SPD=25
' Fade screen,turn off all sprites,bobs and animations then hide screen and
' close it to save memory.
Screen 0 : Fade 1 : Wait 15 : Sprite Off : Sprite Update : Bob Off : Amal Off : Screen Close 0
'
' Call the BSETUP procedure.
_BSETUP
'
' Loop handled in the same way as Mainloop(using screen swap).By using
' another mainloop for the Bonus stage the Game runs faster and smoother.
' Exits out of Loop when the Time limit reaches 0.
Repeat
' Swaps between the Phisical and Logical screens then clears the screen
' of bobs.
Screen Swap 1
Wait Vbl
Bob Clear
'
' Sets the joystic,Calls the TIME and EXTRA LIFE procedures and checks
' for collisions.
_TIME
_EXTRA_LIFE
J=Joy(1)
If I Bob(6)=104 and Spritebob Col(10,6 To 6) Then Bob 6,,,67 : _BDEAD
If I Bob(7)=104 and Spritebob Col(10,7 To 7) Then Bob 7,,,67 : _BDEAD
If I Bob(5)=92 and Spritebob Col(10,5 To 5) Then _BGETITEM
'
' Checks for the joystic and moves Henry either Up or Down.
If J=1 or J=5 or J=9 or J=17 or J=21 or J=25 Then Y=Y-2
If J=2 or J=6 or J=10 or J=18 or J=22 or J=26 Then Y=Y+2
'
' Stops Henry when he gets to the edge.
If X Sprite(10)>426 Then Sprite 10,426,Y,
If X Sprite(10)<160 Then Sprite 10,160,Y,
If Y<88 Then Y=88
If Y>204 Then Y=204
'
' Makes the shadow follow Henry.
Sprite 14,X Sprite(10)-1,226,105
'
' Updates the player sprite and draws all the bobs on screen.
Sprite 10,,Y,
Sprite Update
Bob Draw
'
'-----------------------------------------------------------------------
' Swaps between the Phisical and Logical screens then clears the screen
' of bobs.
Screen Swap 1
Wait Vbl
Bob Clear
_TIME
J=Joy(1)
'
' Checks for the joystic and moves Henry either Up or Down.
If J=1 or J=5 or J=9 or J=17 or J=21 or J=25 Then Y=Y-2
If J=2 or J=6 or J=10 or J=18 or J=22 or J=26 Then Y=Y+2
'
' Stops Henry when he gets to the edge.
If X Sprite(10)>426 Then Sprite 10,426,Y,
If X Sprite(10)<160 Then Sprite 10,160,Y,
If Y<88 Then Y=88
If Y>204 Then Y=204
'
' Makes the shadow follow Henry.
Sprite 14,X Sprite(10)-1,226,105
'
' Updates the player sprite and draws all the bobs on screen.
Sprite 10,,Y,
Sprite Update
Bob Draw
Until TIME=0
'
' Calls the RESTART procedure.
_RESTART
'
End Proc
'
' Shows the Bonus level title screen then sets up the Bonus background and
' enemy animations.
Procedure _BSETUP
'
'Opens a screen then prints the information on the Title screen.
Screen Open 1,320,200,32,Lowres : Screen Hide 1
Palette $0,$777,$554,$555,$554,$444,$333,$222,$554,$555,$554,$444,$333,$222,$554,$665,$554,$444,$333,$222,$FFF,$444,$0,$9B9,$898,$520,$840,$B70,$FB0,$8E,$D01,$EC8
Curs Off : Flash Off : Cls 0 : Paper 0
Pen 23 : Locate 0,3 : Centre " TUNNEL "
Pen 28 : Locate 0,6 : Centre "Bonus Level"
Pen 29 : Locate 0,9 : Centre "Collect the pumpkins for points"
Locate 0,11 : Centre "while avoiding the bats and within"
Locate 0,13 : Centre "the time limit."
Pen 30 : Locate 0,20 : Centre "Press Fire to start"
' Prints the new Time limit.
Screen 2 : Ink 2,0 : Text 278,20,"60"
'
' Sets the Amal animation for the Broomstic on the title screen.
Screen 1
Channel 9 To Sprite 10
Sprite 10,294,184,
I$=I$+"A 0,(76,5)(77,5)(78,5)(77,5);"
Amal 9,I$ : Amal On 9
Screen Show 1
'
' Small loop which exits when you press Fire.
Do
F=Fire(1)
If F=-1 Then Exit
Sprite 10,,, : Sprite Update : Wait Vbl
Loop
' Small loop which exits once you have released the Fire button.
Repeat
Sprite 10,,, : Sprite Update : Wait Vbl
Until Fire(1)=0
' Fade title screen then turn off Amal animation.
Fade 1 : Amal Off 9 : Wait 15
'
' Unpack the Bonus Background to screen 1 then hide it.
Unpack 11 To 1 : Screen Hide 1
Screen 1
' Double Buffer screen for no flicker,turn Autoback to manual,turn Update
' off then Update every 2 for smoother animation.
Double Buffer
Autoback 0 : Update Off : Update Every 2
'
' Activate the shifting of colours in the background to give the illusion
' of movement.
Shift Down 3,2,19,1
'
' Set the Player and enemy starting position and the Amal channels.
Y=164
Channel 5 To Sprite 10
Channel 6 To Bob 5
Channel 7 To Bob 6
Channel 8 To Bob 7
Sprite 10,294,164,
Sprite 14,296,190,105
Bob 5,150,100,67
Bob 6,160,90,67
Bob 7,170,110,67
'
' Set the Player Amal animation string.
E$=E$+"A: If J1=0 then Jump F ;"
E$=E$+"B: If J1&4 then Jump G ;" : Rem left
E$=E$+"C: If J1&8 then Jump H ;" : Rem right
E$=E$+"D: If J1&1 then Jump I ;" : Rem up
E$=E$+"E: If J1&2 then Jump J ;" : Rem down
E$=E$+"Jump A ;"
E$=E$+"F: A 0,(76,4)(77,3)(78,4)(77,3); M 0,0,14 ; Jump A;"
E$=E$+"G: A 1,(79,5); M -10,0,5; Jump B;"
E$=E$+"H: A 1,(80,5); M 10,0,5; Jump C;"
E$=E$+"I: A 1,(76,2); Jump D "
E$=E$+"J: A 1,(76,2); Jump E;"
'
' Set the Amal animation strings for the Pumpkin and the 2 Bats.
F$="Pumpkin:A 1,(67,10)(81,5)(82,5)(83,5)(84,5)(85,5)(86,5)(87,5)(88,5)(89,5)(90,5)(91,5)(92,5)(67,5); M -40,0,75;"
F$=F$+"A 0,(67,5); M 60,-10,5; A 1,(67,5)(81,5)(82,5)(83,5)(84,5)(85,5)(86,5)(87,5)(88,5)(89,5)(90,5)(91,5)(92,5)(67,5); M 50,-20,70"
F$=F$+"A 0,(67,5); M -60,30,5; A 1,(67,5)(81,5)(82,5)(83,5)(84,5)(85,5)(86,5)(87,5)(88,5)(89,5)(90,5)(91,5)(92,5)(67,5); M 20,70,70"
F$=F$+"A 0,(67,5); M -24,-64,5; A 1,(67,5)(81,5)(82,5)(83,5)(84,5)(85,5)(86,5)(87,5)(88,5)(89,5)(90,5)(91,5)(92,5)(67,5); M 10,-60,70"
F$=F$+"A 0,(67,5); M -10,60,5; A 1,(67,5)(81,5)(82,5)(83,5)(84,5)(85,5)(86,5)(87,5)(88,5)(89,5)(90,5)(91,5)(92,5)(67,5); M -50,-30,70"
F$=F$+"A 0,(67,5); M 50,20,5; A 1,(67,5)(81,5)(82,5)(83,5)(84,5)(85,5)(86,5)(87,5)(88,5)(89,5)(90,5)(91,5)(92,5)(67,5); M 70,-30,70;"
F$=F$+"A 0,(67,5); M -80,40,5; A 1,(67,5)(81,5)(82,5)(83,5)(84,5)(85,5)(86,5)(87,5)(88,5)(89,5)(90,5)(91,5)(92,5)(67,5); M -40,60,70;"
F$=F$+"A 0,(67,5); M 44,-66,5;Jump Pumpkin;"
'
G$="Bat:A 0,(67,20); M 0,0,20; A 1,(93,5)(94,5)(95,5)(96,5)(97,5)(98,5)(99,5)(100,5)(101,5)(102,5)(103,5)(104,5)(67,5); M -10,-60,65;"
G$=G$+"A 0,(67,5); M 10,60,5; A 1,(67,5)(93,5)(94,5)(95,5)(96,5)(97,5)(98,5)(99,5)(100,5)(101,5)(102,5)(103,5)(104,5)(67,5); M 30,60,75;"
G$=G$+"A 0,(67,5); M -40,-50,5; A 1,(67,5)(93,5)(94,5)(95,5)(96,5)(97,5)(98,5)(99,5)(100,5)(101,5)(102,5)(103,5)(104,5)(67,5); M -40,70,75;"
G$=G$+"A 0,(67,5); M 50,-60,5; A 1,(67,5)(93,5)(94,5)(95,5)(96,5)(97,5)(98,5)(99,5)(100,5)(101,5)(102,5)(103,5)(104,5)(67,5); M 0,-60,75;"
G$=G$+"A 0,(67,5); M -10,50,5; A 1,(67,5)(93,5)(94,5)(95,5)(96,5)(97,5)(98,5)(99,5)(100,5)(101,5)(102,5)(103,5)(104,5)(67,5); M -70,-0,75;"
G$=G$+"A 0,(67,5); M 80,0,5; A 1,(67,5)(93,5)(94,5)(95,5)(96,5)(97,5)(98,5)(99,5)(100,5)(101,5)(102,5)(103,5)(104,5)(67,5); M 70,60,75;"
G$=G$+"A 0,(67,5); M -80,-60,5; A 1,(67,5)(93,5)(94,5)(95,5)(96,5)(97,5)(98,5)(99,5)(100,5)(101,5)(102,5)(103,5)(104,5)(67,5); M -70,-10,75;"
G$=G$+"A 0,(67,5); M 80,0,5; Jump Bat;"
'
H$="Two:A 0,(67,30); M 0,0,40; A 1,(93,4)(94,4)(95,4)(96,4)(97,4)(98,4)(99,4)(100,4)(101,4)(102,4)(103,4)(104,4)(67,4); M 10,60,52;"
H$=H$+"A 0,(67,4); M -30,-80,4; A 1,(67,4)(93,4)(94,4)(95,4)(96,4)(97,4)(98,4)(99,4)(100,4)(101,4)(102,4)(103,4)(104,4)(67,4); M -60,40,56;"
H$=H$+"A 0,(67,4); M 60,-40,4; A 1,(67,4)(93,4)(94,4)(95,4)(96,4)(97,4)(98,4)(99,4)(100,4)(101,4)(102,4)(103,4)(104,4)(67,4); M -20,-60,56;"
H$=H$+"A 0,(67,4); M 40,70,4; A 1,(67,4)(93,4)(94,4)(95,4)(96,4)(97,4)(98,4)(99,4)(100,4)(101,4)(102,4)(103,4)(104,4)(67,4); M 40,-70,56;"
H$=H$+"A 0,(67,4); M -50,70,4; A 1,(67,4)(93,4)(94,4)(95,4)(96,4)(97,4)(98,4)(99,4)(100,4)(101,4)(102,4)(103,4)(104,4)(67,4); M 0,60,56;"
H$=H$+"A 0,(67,4); M -2,-66,4; A 1,(67,4)(93,4)(94,4)(95,4)(96,4)(97,4)(98,4)(99,4)(100,4)(101,4)(102,4)(103,4)(104,4)(67,4); M -80,-20,56;"
H$=H$+"A 0,(67,4); M 80,30,4; A 1,(67,4)(93,4)(94,4)(95,4)(96,4)(97,4)(98,4)(99,4)(100,4)(101,4)(102,4)(103,4)(104,4)(67,4); M 60,-80,56;"
H$=H$+"A 0,(67,4); M -48,86,4; Jump Two;"
'
' Set Channels to Animation strings and turn Amal Animations on.
Amal 5,E$ : Amal 6,F$ : Amal 7,G$ : Amal 8,H$
Amal On
'
' Show Bonus screen.
Screen Show 1
'
End Proc
'
' Clears the Pumpkin and updates your score once collected.
Procedure _BGETITEM
'
' Clears Pumpkin off screen by giving it a blank image then plays the
' Collect sfx and updates the EXSC variable.
Bob 5,,,67 : Sam Bank 5 : Sam Play %1110,4 : A=A+1 : EXSC=EXSC+25
'
Screen 2
' Updates your score variable.
SC=SC+25
' Turn score variable to string so it can be printed using 'Text'.
C$=Str$(SC) : Text 144,20,C$
' Return to screen 1.
Screen 1
'
End Proc
'
' Updates the lives,sets the death animation then plays it until its finished.
Procedure _BDEAD
'
' This is a seperate DEAD procedure for the Bonus stage.
' Decrease the LIVES by 1 then convert variable to string to display lives.
Screen 2
LIVES=LIVES-1
B$=Str$(LIVES) : LD=Text Length(B$) : Text 64-LD,20,B$
'
Screen 1
' Match the Bob starting position with the Player sprite position.
DX=X Screen(X Sprite(10)) : DY=Y Screen(Y Sprite(10))
Bob 26,DX,DY,107
Limit Bob 26,0,17 To 320,182
' Set Amal animation.
Channel 10 To Bob 26
J$="A 0,(107,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,200,46"
Amal 10,J$ : Amal On 10
' Turn off Player and Shadow sprites then play Ouch sfx and update bobs.
Sprite Off 10 : Sprite Off 14
Sam Bank 5 : Sam Play %1110,2
'
' Small loop to allow Henry to finish death sequence without causing any
' problems to the Bonus mainloop eg,colliding while still playing the death anim.
Repeat
Screen Swap 1
Wait Vbl
Bob Clear
_TIME
'
Sprite Update
Bob Draw
'
Screen Swap 1
Wait Vbl
Bob Clear
'
Sprite Update
Bob Draw
Until Y Bob(26)>200
'
' Turns off player bob and animation.
Bob Off 26 : Amal Off 10
' If player has lost all their lives then call the GAMEOVER procedure.
If LIVES=0 Then _GAMEOVER
'
' Reset the Amal Channel and player starting position.
Channel 5 To Sprite 10
Y=164 : Sprite 10,294,164,
' Set the Player Amal animation strings.
E$=E$+"A: If J1=0 then Jump F ;"
E$=E$+"B: If J1&4 then Jump G ;" : Rem left
E$=E$+"C: If J1&8 then Jump H ;" : Rem right
E$=E$+"D: If J1&1 then Jump I ;" : Rem up
E$=E$+"E: If J1&2 then Jump J ;" : Rem down
E$=E$+"Jump A ;"
E$=E$+"F: A 0,(76,4)(77,3)(78,4)(77,3); M 0,0,14 ; Jump A;"
E$=E$+"G: A 1,(79,5); M -10,0,5; Jump B;"
E$=E$+"H: A 1,(80,5); M 10,0,5; Jump C;"
E$=E$+"I: A 1,(76,2); Jump D "
E$=E$+"J: A 1,(76,2); Jump E;"
' Set the Channel to the string then turn on the Amal animation.
Amal 5,E$ : Amal On 5
'
'Swap the screen and clear the bobs on screen to help stay in sync.
Screen Swap 1 : Wait Vbl : Bob Clear
'
End Proc